https://se.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://se.mathworks.com/images/membrane_icon.gif

Mon, 25 Sep 2017 02:23:06 +0000
How to specify spectrogram plot to use "seconds" unit instead of "minutes" unit?
https://se.mathworks.com/matlabcentral/newsreader/view_thread/349522#956348
Baha411
How to specify spectrogram plot to use "seconds" unit instead of minutes? <br>
<br>
Fs = 1000;<br>
dt_ = 1/Fs;<br>
t = 0:dt_:100dt_; % time<br>
y = chirp(t,100,1,200,'quadratic'); <br>
window_leng = 100; <br>
noverlap = 80;<br>
f_spec = 100;<br>
[s_psd0,f_psd0,t_psd0,p_psd0] = spectrogram(y,window_leng,noverlap,f_spec,Fs);<br>
figure;<br>
spectrogram(y,window_leng,noverlap,f_spec,Fs,'yaxis'); % spectrogram(y,100,80,100,Fs,'yaxis')<br>
ylabel('Frequency, Hz (1/sec)');<br>
<br>
As you can see it is converting the xtick labels to "mins". <br>
<br>
One solution is this below:<br>
Xlim = get(gca, 'xlim');<br>
set(gca, 'XTick', linspace(Xlim(1), Xlim(2), 20));<br>
set(gca, 'XTicklabel', 0:100:2000);<br>
but with this I will not have dynamic xlabels changing to finer values if I zoom in or zoom out.<br>
<br>
Can I specify/enforce spectrogram to always use seconds unit?

Mon, 25 Sep 2017 00:20:09 +0000
verify some expressions related to the normal pdf through symbolic integration
https://se.mathworks.com/matlabcentral/newsreader/view_thread/349521#956347
leo nidas
Hi all,<br>
<br>
I would like to verify through matlab some expressions that hold for the univariate and bivariate normal densities. My final goal is to calculate Rf1, Rf11 and Rf22 as well as A that I define in the fully reproducible code below (these are related to the integrals of the squared derivative of the density). In the comments below I also supply the value that I expect to derive based on a textbook. I see that integration is not successful (apart from Rf1) in a sense that "int" does not yield a result and furthermore I get a critical error for "A". I do not care about numerical integrations that would do the job in specific examples. I would like to verify the general formulas. Am I doing something wrong? Am I missusing any function?<br>
<br>
Thank you in advance for any answers.<br>
<br>
%=========CODE==========================<br>
<br>
close all<br>
clear all<br>
clc<br>
<br>
syms x1 x2 r real<br>
syms s1 s2 pi positive <br>
assume(r>1 & r<1)<br>
<br>
m1=0;<br>
m2=0;<br>
<br>
<br>
z=((x1m1)^2)/(s1^2)+((x2m2)^2)/(s2^2)(2*r*(x1m1)*(x2m2))/(s1*s2)<br>
f2d=1/(2*pi*s1*s2*sqrt(1r^2))*exp(z/(2*(1r^2))) %bivariate normal <br>
<br>
<br>
%========1D NORMAL======(goal: integral of the squared 2nd derivative)<br>
f1d=1/(s1*sqrt(2*pi))*exp((x1m1)^2/(2*s1^2)); %univariate normal<br>
check_univariate_integrates_to_one=int(f1d,'x1',Inf,Inf) %indeed it does<br>
f1=diff(f1d,'x1',2) %second deerivative of the univariate density<br>
Rf1=int(f1^2,'x1',Inf,Inf) %and its integral<br>
% I know that Rf1 should be 3/(8*pi^(1/2)*s1^5) (and indeed it is!)<br>
<br>
%========2D NORMAL======(goal: 2D integral of the squared 2nd derivative)<br>
check_2D_integrates_to_one=int(int(f2d,'x2',Inf,Inf),'x1',Inf,Inf) %indeed it does<br>
f11=diff(f2d,'x1',2) %second derivative of the bivariate density w.r.t. x1<br>
f22=diff(f2d,'x2',2) %second derivative of the bivariate density w.r.t. x2<br>
<br>
Rf11=int(int(f11^2,'x1',Inf,Inf),'x2',Inf,Inf) %and its 2D integral<br>
Rf22=int(int(f22^2,'x1',Inf,Inf),'x2',Inf,Inf) %and its 2D integral<br>
<br>
%I know that Rf11 should be 3/(16*pi*(1r^2)^(5/2)*s1^5*s2) but "int" fails<br>
%I know that Rf22 should be 3/(16*pi*(1r^2)^(5/2)*s1*s2^5) but "int" fails<br>
<br>
%=====additional calculation==========<br>
A=int(int(f11*f22,'x1',Inf,Inf),'x2,'Inf,Inf)<br>
%I know that A should be (1+2*r^2)/(16*pi*(1r^2)^(5/2)*s1^3*s2^3) but int fails<br>
<br>
<br>
%all these results are in the book of Scott:<br>
%"Multivariate Density Estimation Theory Practice and Visualization"<br>
%page 163.

Sun, 24 Sep 2017 19:13:05 +0000
MATLAB Icon Next to File Has Disappeared
https://se.mathworks.com/matlabcentral/newsreader/view_thread/349517#956342
Mason Law
I recently updated Matlab from R2015b to R2017a and in doing so, all old and newly created Matlab files (.m) have no icon next to them. Rather, they have the generic white sheet (kind of like a .txt file icon). Does anyone have any ideas on how to fix this?<br>
<br>
This link is a screenshot of what all of my .m file icons look like: https://imgur.com/a/bI5QT<br>
<br>
Matlab runs perfectly, but files simply do not have the matlab icon next to it in Finder.<br>
<br>
I have tried restarting my Mac while holding Option + Command  no change<br>
I have tries clearing my icon cache  no change<br>
<br>
Thanks in advance!

Sun, 24 Sep 2017 07:23:07 +0000
Re: " Your MATLAB license will expire in xx days"
https://se.mathworks.com/matlabcentral/newsreader/view_thread/349516#956340
fsda
INCREMENT Aerospace_Blockset MLM 99 permanent uncounted \<br>
A05070F00D1EB1F92326 VENDOR_STRING=QQ=47399897 HOSTID=ANY \<br>
ck=216 SN=888888 TS_OK<br>
INCREMENT Aerospace_Toolbox MLM 99 permanent uncounted \<br>
6090F0C08395D4289512 VENDOR_STRING=QQ=47399897 HOSTID=ANY \<br>
ck=237 SN=888888 TS_OK<br>
INCREMENT Bioinformatics_Toolbox MLM 99 permanent uncounted \<br>
40E0B0406DE56D23A426 VENDOR_STRING=QQ=47399897 HOSTID=ANY \<br>
ck=190 SN=888888 TS_OK

Sat, 23 Sep 2017 14:40:12 +0000
key activation
https://se.mathworks.com/matlabcentral/newsreader/view_thread/349515#956339
Rossi Zakaria
Good morning,<br>
<br>
Please i need the key for activation to activate my version Matlab r2009a<br>
<br>
Host ID: DISK_SERIAL_NUM=5cbf3038 Release: R2009a Windows User Name: windows 7 professionnel 64bit<br>
<br>
Thanks so much for your help.

Sat, 23 Sep 2017 13:35:08 +0000
Re: Which is best segmenttaion technique for urdu (arabic) handwritten
https://se.mathworks.com/matlabcentral/newsreader/view_thread/349493#956338
Image Analyst
Saud Ahmed <br>
The "best" one is in whatever papers are listed here: <a href="http://www.visionbib.com/bibliography/contentschar.html#OCR,%20Document%20Analysis%20and%20Character%20Recognition%20Systems">http://www.visionbib.com/bibliography/contentschar.html#OCR,%20Document%20Analysis%20and%20Character%20Recognition%20Systems</a><br>
<br>
in these sections<br>
<br>
23.4.8.2 Arabic Character Recognition<br>
23.4.8.3 Arabic Recognition, Word Level, Word Spotting <br>
<br>
Obviously, for every paper listed there, that its author thinks his/her method is the best.

Fri, 22 Sep 2017 17:15:09 +0000
Re: Convex preserving interpolation
https://se.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://se.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://se.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://se.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://se.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://se.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://se.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://se.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://se.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.