https://cn.mathworks.com/matlabcentral/newsreader/most_recent_feed
MATLAB Central Newsreader Recent Posts
Most Recent Posts
enus
©19942017 by MathWorks, Inc.
webmaster@mathworks.com
MATLAB Central Newsreader
http://blogs.law.harvard.edu/tech/rss
60
MathWorks
https://cn.mathworks.com/images/membrane_icon.gif

Fri, 22 Sep 2017 17:15:09 +0000
Re: Convex preserving interpolation
https://cn.mathworks.com/matlabcentral/newsreader/view_thread/347091#956333
Bruno Luong
"Bjorn Gustavsson" wrote in message <oq31qc$bt5$1@newscl01ah.mathworks.com>...<br>
<br>
> I think you oversimplify. The OP had a _monotonic_ concave function that he wanted approximated at a number of gridpoints, and then wanted to obtain the function at a finer grid and wanted an interpolation that would preserve those properties. As far as I understand the meaning of monotonic your example is not at all relevant to that discussion, since it is not monotonic.<br>
<br>
I think you read another question than mine (?).<br>
<br>
I reply to post #9, sorry I don't see where he/she specifies grid points, concave, etc ...

Fri, 22 Sep 2017 13:05:16 +0000
Re: Convex preserving interpolation
https://cn.mathworks.com/matlabcentral/newsreader/view_thread/347091#956331
Bjorn Gustavsson
"Bruno Luong" wrote in message <oq0rag$br9$1@newscl01ah.mathworks.com>...<br>
> "Bjorn Gustavsson" wrote in message <oq0l5i$s60$1@newscl01ah.mathworks.com>...<br>
> <br>
> > ><br>
> > That is an example of a sampling from a function that is possibly convex,<br>
> <br>
> It basically a saddle point, two principal curvatures have opposite signs, so it's no convex nor concave.<br>
> <br>
> <br>
> > but I have a hard time seeing that it could be from a function that is monotonic in any(?) meaningful way. Or have I missunderstood something?<br>
> <br>
> I just show (in the simple example) that such interpolation function that preserves monotony as requested by OP (meaning linederivative does not change sign for any segmentline that connects a pair of "neighbor" data points) does not exists. So of course you can imagine the difficulty for anyone to a hard time to see such function. ;) <br>
<br>
I think you oversimplify. The OP had a _monotonic_ concave function that he wanted approximated at a number of gridpoints, and then wanted to obtain the function at a finer grid and wanted an interpolation that would preserve those properties. As far as I understand the meaning of monotonic your example is not at all relevant to that discussion, since it is not monotonic.

Fri, 22 Sep 2017 11:34:09 +0000
Re: Speed of new graphics engine
https://cn.mathworks.com/matlabcentral/newsreader/view_thread/337755#956330
Bruno Luong
Just make few quick tests with R2017b, can't see any obvious speed improvement with R2017a (bar animation is even slightly slower, with new default color and more flexible color setting).<br>
<br>
I see in the Release Notes that "Tall Array Support: Visualize outofmemory data using plot, scatter, and binscatter" with zooming supported.<br>
<br>
Not sure if one can hack it to improve speed of large data.

Fri, 22 Sep 2017 10:48:06 +0000
Re: ColorScale in Excel using matlab
https://cn.mathworks.com/matlabcentral/newsreader/view_thread/349394#956329
Jessica Buckley
"Steven Lord" wrote in message <oq0ifa$mm0$1@newscl01ah.mathworks.com>...<br>
> "Jessica Buckley" wrote in message <onjavs$7as$1@newscl01ah.mathworks.com>...<br>
> > I have a Matlab function that creates an excel file that displays data from multiple sources in one big spreadsheet (using activex). Multiple sheets are created but rather than copy the data and paste the values in the cells, excel functions (such as VLOOKUP or INDIRECT) are used to display the data. Therefore, I can't apply a colorScale using the values directly in Matlab. I have previously applied conditional formatting to this data but now I wish to add a colour scale. I have found VBA documentation on how to do this but cant get it to work in Matlab. <br>
> > <br>
> > %this is accepted by matlab<br>
> > ColorScale=eR.FormatConditions.AddColorScale(2); <br>
> <br>
> What is eR in this code? Is it a COM object referring to some part of the spreadsheet?<br>
> <br>
> https://www.mathworks.com/help/matlab/usingcomobjectsinmatlab.html<br>
> <br>
> > %this returns an error : Undefined function or variable 'FormatColor'.<br>
> > CS.ColorScaleCriteria(1).FormatColor.ColorIndex = 5;<br>
> <br>
> What is CS? Is it a COM object, a MATLAB object or struct, etc.?<br>
> <br>
>  <br>
> Steve Lord<br>
> slord@mathworks.com<br>
> To contact Technical Support, use the Contact Us link at the top of <a href="http://www.mathworks.com">http://www.mathworks.com</a><br>
<br>
Yes sorry eR is a range from the spreadsheet <br>
CS should be ColorScale I forgot to correct these terms when i copied them into the message

Fri, 22 Sep 2017 09:35:08 +0000
Re: Convex preserving interpolation
https://cn.mathworks.com/matlabcentral/newsreader/view_thread/347091#956328
Bruno Luong
Related topic : FYI starting from R2017B, MATLAB provides Akima cubic Hermite interpolation<br>
<a href="http://www.alglib.net/interpolation/spline3.php#header5">http://www.alglib.net/interpolation/spline3.php#header5</a>

Fri, 22 Sep 2017 02:07:06 +0000
Re: 30 SECOND RANKINGS OF MATLAB NN REGRESSION EXAMPLES
https://cn.mathworks.com/matlabcentral/newsreader/view_thread/349509#956327
Greg Heath
> chemical_dataset 8 1 498 0.0559 0.0406<br>
> <br>
> building_dataset 14 3 4208 0.1774 0.1753 <br>
> 3. The increase in error rate between the 4th and 5th datasets is ~ 13%.<br>
<br>
WRONG !!!<br>
<br>
100 * ( 0.1774  0.0559 ) / 0.0559 ~ 217 %<br>
100 * ( 0.1753  0.0406 ) / 0.0406 ~ 332% <br>
<br>
<br>
Sorry (rusty slide rule )<br>
<br>
Greg

Thu, 21 Sep 2017 17:02:08 +0000
Re: Convex preserving interpolation
https://cn.mathworks.com/matlabcentral/newsreader/view_thread/347091#956323
Bruno Luong
"Bjorn Gustavsson" wrote in message <oq0l5i$s60$1@newscl01ah.mathworks.com>...<br>
<br>
> ><br>
> That is an example of a sampling from a function that is possibly convex,<br>
<br>
It basically a saddle point, two principal curvatures have opposite signs, so it's no convex nor concave.<br>
<br>
<br>
> but I have a hard time seeing that it could be from a function that is monotonic in any(?) meaningful way. Or have I missunderstood something?<br>
<br>
I just show (in the simple example) that such interpolation function that preserves monotony as requested by OP (meaning linederivative does not change sign for any segmentline that connects a pair of "neighbor" data points) does not exists. So of course you can imagine the difficulty for anyone to a hard time to see such function. ;)

Thu, 21 Sep 2017 15:17:06 +0000
Re: Convex preserving interpolation
https://cn.mathworks.com/matlabcentral/newsreader/view_thread/347091#956322
Bjorn Gustavsson
"Bruno Luong" wrote in message <oq07q3$6o$1@newscl01ah.mathworks.com>...<br>
> It is easily to show the request of monotonicpreserving is impossible in 2D in general.<br>
> <br>
> Let's take a 4 data points (x,y), z=f(x,y):<br>
> (0,0), 0<br>
> (1,0), 1<br>
> (1,1), 0<br>
> (0,1), 1<br>
> <br>
> f is interpolation function to be found, given (x,y,z) at those 4 points.<br>
> <br>
> On the diagonal from (0,0) to (1,1), data points z are 0 and 0, so the f(x,y) must be 0 on this diagonal (increasing and decrasing at the same time).<br>
> <br>
> On the (anti)diagonal from (1,0) to (0,1), data points z are 1 and 1, so the f(x,y) must be 1 on this other diagonal (similar logic).<br>
> <br>
> So f(0.5,0.5) must be 0 and 1 at the same time, which is of course impossible.<br>
><br>
That is an example of a sampling from a function that is possibly convex, but I have a hard time seeing that it could be from a function that is monotonic in any(?) meaningful way. Or have I missunderstood something?

Thu, 21 Sep 2017 14:38:07 +0000
Re: xPC Target Warning: No data has been selected for uploading.
https://cn.mathworks.com/matlabcentral/newsreader/view_thread/309313#956321
Julie Wagner
Did you ever find a reason why this occurs / solution to this error? I am encountering something similar now using Matlab 2008a.

Thu, 21 Sep 2017 14:31:06 +0000
Re: ColorScale in Excel using matlab
https://cn.mathworks.com/matlabcentral/newsreader/view_thread/349394#956320
Steven Lord
"Jessica Buckley" wrote in message <onjavs$7as$1@newscl01ah.mathworks.com>...<br>
> I have a Matlab function that creates an excel file that displays data from multiple sources in one big spreadsheet (using activex). Multiple sheets are created but rather than copy the data and paste the values in the cells, excel functions (such as VLOOKUP or INDIRECT) are used to display the data. Therefore, I can't apply a colorScale using the values directly in Matlab. I have previously applied conditional formatting to this data but now I wish to add a colour scale. I have found VBA documentation on how to do this but cant get it to work in Matlab. <br>
> <br>
> %this is accepted by matlab<br>
> ColorScale=eR.FormatConditions.AddColorScale(2); <br>
<br>
What is eR in this code? Is it a COM object referring to some part of the spreadsheet?<br>
<br>
https://www.mathworks.com/help/matlab/usingcomobjectsinmatlab.html<br>
<br>
> %this returns an error : Undefined function or variable 'FormatColor'.<br>
> CS.ColorScaleCriteria(1).FormatColor.ColorIndex = 5;<br>
<br>
What is CS? Is it a COM object, a MATLAB object or struct, etc.?<br>
<br>
 <br>
Steve Lord<br>
slord@mathworks.com<br>
To contact Technical Support, use the Contact Us link at the top of <a href="http://www.mathworks.com">http://www.mathworks.com</a>

Thu, 21 Sep 2017 12:56:04 +0000
Re: ColorScale in Excel using matlab
https://cn.mathworks.com/matlabcentral/newsreader/view_thread/349394#956319
Jessica Buckley
"Jessica Buckley" wrote in message <onjavs$7as$1@newscl01ah.mathworks.com>...<br>
> I have a Matlab function that creates an excel file that displays data from multiple sources in one big spreadsheet (using activex). Multiple sheets are created but rather than copy the data and paste the values in the cells, excel functions (such as VLOOKUP or INDIRECT) are used to display the data. Therefore, I can't apply a colorScale using the values directly in Matlab. I have previously applied conditional formatting to this data but now I wish to add a colour scale. I have found VBA documentation on how to do this but cant get it to work in Matlab. <br>
> <br>
> %this is accepted by matlab<br>
> ColorScale=eR.FormatConditions.AddColorScale(2); <br>
> %this returns an error : Undefined function or variable 'FormatColor'.<br>
> CS.ColorScaleCriteria(1).FormatColor.ColorIndex = 5;<br>
> <br>
> Any help would be greatly appreciated<br>
<br>
I have found a temporary solution:<br>
Create a VBA macro in a template excel file that receives a range and applies a color scale to this range. From Matlab you an call/execute the macro using the same activex server.You then close the template file and the color scale will have been applied to the range.<br>
<br>
range='A1:Z40';<br>
WB=Excel.Workbooks.Open(fullfile(filepath,'\templatefile.xlsm'));<br>
Excel.Application.Run('MacroStorage.ColorScaleMacro',range);<br>
WB.Close;<br>
<br>
This is obviously not ideal as the file needs to be accessible but works for now.

Thu, 21 Sep 2017 11:29:07 +0000
Re: Convex preserving interpolation
https://cn.mathworks.com/matlabcentral/newsreader/view_thread/347091#956318
Bruno Luong
It is easily to show the request of monotonicpreserving is impossible in 2D in general.<br>
<br>
Let's take a 4 data points (x,y), z=f(x,y):<br>
(0,0), 0<br>
(1,0), 1<br>
(1,1), 0<br>
(0,1), 1<br>
<br>
f is interpolation function to be found, given (x,y,z) at those 4 points.<br>
<br>
On the diagonal from (0,0) to (1,1), data points z are 0 and 0, so the f(x,y) must be 0 on this diagonal (increasing and decrasing at the same time).<br>
<br>
On the (anti)diagonal from (1,0) to (0,1), data points z are 1 and 1, so the f(x,y) must be 1 on this other diagonal (similar logic).<br>
<br>
So f(0.5,0.5) must be 0 and 1 at the same time, which is of course impossible.

Thu, 21 Sep 2017 05:49:08 +0000
30 SECOND RANKINGS OF MATLAB NN REGRESSION EXAMPLES
https://cn.mathworks.com/matlabcentral/newsreader/view_thread/349509#956316
Greg Heath
30 SECOND RANKINGS OF MATLAB NN REGRESSION EXAMPLE <br>
DATASETS<br>
<br>
Very often attempts to become proficient in NN design become thwarted because of unfortunate choices in references and/or available data.<br>
<br>
To help lighten the load I have ranked the eight MATLAB NN example datasets for regression which can be obtained using the doc and help commands via<br>
<br>
doc nndatasets<br>
and<br>
help nndatasets<br>
<br>
The example datasets with dimensions are listed below in order of normalized mean square error. NMSE1 was obtained initializing the RNG before each case. NMSE2 was obtained only initializing the RNG at the beginning of the program.<br>
<br>
There seems to be a clear jump in difficulty between the 4th and 5th datasets. This is indicated by the dashed line.<br>
<br>
A RANKING OF MATLAB NN REGRESSION DATASETS<br>
<br>
simplefit_dataset  Simple fitting dataset.<br>
vinyl_dataset  Vinyl bromide dataset.<br>
engine_dataset  Engine behavior dataset.<br>
chemical_dataset  Chemical sensor dataset.<br>
<br>
building_dataset  Building energy dataset.<br>
cho_dataset  Cholesterol dataset.<br>
bodyfat_dataset  Body fat percentage dataset.<br>
abalone_dataset  Abalone shell rings dataset.<br>
========================================= <br>
NAME SIZES NMSE1 NMSE2<br>
simplefit_dataset 1 1 94 0.0000 0.0000<br>
vinyl_dataset 16 1 68308 0.0065 0.0062<br>
engine_dataset 2 2 1199 0.0080 0.0085<br>
chemical_dataset 8 1 498 0.0559 0.0406<br>
<br>
building_dataset 14 3 4208 0.1774 0.1753 <br>
cho_dataset 21 3 264 0.1785 0.1885 <br>
bodyfat_dataset 13 1 252 0.2769 0.3020 <br>
abalone_dataset 8 1 4177 0.4053 0.4018<br>
<br>
Since the two rankings are consistent, they may be of interest to experts as well as beginners.<br>
<br>
Final remarks<br>
<br>
1. The sparse code was based on that in the help/doc documentation examples and is similar to tose in my QUICKIES posts.<br>
2. The scalefree NORMALIZED MEAN SQUARE ERROR used to rank the data sets is related to the Rsquare statistic via <br>
RSQUARE = 1NMSE ( see WIKIPEDIA)<br>
3. The increase in error rate between the 4th and 5th datasets is ~ 13%.<br>
<br>
close all, clear all, clc ,tic <br>
rng(0)<br>
for i = 1:8<br>
NMSE<br>
if i==1, [x,t] = simplefit_dataset; % 0.0000<br>
elseif i==2, [x,t] = vinyl_dataset; % 0.0065<br>
elseif i==3, [x,t] = engine_dataset; % 0.0080<br>
elseif i==4, [x,t] = chemical_dataset; % 0.0559<br>
elseif i==5, [x,t] = building_dataset; % 0.1774<br>
elseif i==6, [x,t] = cho_dataset; % 0.1785 <br>
elseif i==7, [x,t] = bodyfat_dataset; % 0.2769<br>
else [x,t] = abalone_dataset; % 0.4053 <br>
end <br>
<br>
SIZES( i,1:3 ) = [ size( x,1 ) size( t ) ];<br>
rng( 0 ) % Inactive for NMSE2<br>
[ net tr y e ] = train( fitnet, x, t ); <br>
NMSE( i, 1 ) = mse( e ) / mean( var( t', 1 ) );<br>
<br>
end<br>
<br>
TITLE = 'RANKING OF NN REGRESSION EXAMPLE DATASETS'<br>
SIZES = SIZES'<br>
NMSE = NMSE'<br>
toc <br>
<br>
SIZES = 1 16 2 8 <br>
1 1 2 1 <br>
94 68308 1199 498 <br>
NMSE1 = 0.0000 0.0065 0.0080 0.0559 <br>
NMSE2 = 0.0000 0.0062 0.0085 0.0406 <br>
<br>
SIZES = 14 21 13 8<br>
3 3 1 1<br>
4208 264 252 4177<br>
NMSE1 = 0.1774 0.1785 0.2769 0.4053 <br>
NMSE2 = 0.1753 0.1885 0.3020 0.4018<br>
<br>
toc % Elapsed time is < 30 seconds for each run<br>
<br>
The purpose of this post was to demonstrate how to get a quick assessment of the relative difficulty in obtaining useful NN regression models. The <br>
extension to classification and timeseries models in the following posts is made straight forward by also using NMSE. <br>
<br>
Refinements like trn/val/tst data division and minimizing the number of hidden nodes by searching over random initial weights are relegated to later stages of investigation.<br>
<br>
Hope this helps.<br>
<br>
Greg

Wed, 20 Sep 2017 20:49:07 +0000
Re: Convex preserving interpolation
https://cn.mathworks.com/matlabcentral/newsreader/view_thread/347091#956314
John D'Errico
"Sargondjani" wrote in message <opqsfk$noo$1@newscl01ah.mathworks.com>...<br>
> Now I need a bivariate convex/concave & monoticity preserving interpolation method. <br>
> <br>
> So my question is: does anyone have a matlab routine for a bivariate convexity/concavity & monoticity preserving interpolation method???<br>
<br>
<br>
This can be moderately difficult to ensure. As I recall, even a tool like pchip, when used in a tensor product form, need not be monotonic in 2d. Even simpler, tensor product linear interpolation can easily be seen to be nonmonotonic under the correct circumstances.<br>
<br>
For example, you can trivially construct a tensor product linear interpolant on a single unit square region, that has the property that while clearly monotonic along any line parallel to an axis, yet along either diagonal of the square, the interpolant has clearly nonmonotonic behavior. The same can be true along any line through the square that is not parallel to an axis.<br>
<br>
John

Wed, 20 Sep 2017 06:14:19 +0000
matlab code for iris recognition
https://cn.mathworks.com/matlabcentral/newsreader/view_thread/106727#956311
nithzz1993@gmail.com
Sir I am doing my final project about iridology, can you please send me those codes..