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

Thu, 27 Apr 2017 04:18:03 +0000
Re: Gumbel distribution
https://jp.mathworks.com/matlabcentral/newsreader/view_thread/306364#953530
Amir R
"Frank" wrote in message <839ca730fce84d2ea2bf0aecb325039f@m23g2000prl.googlegroups.com>...<br>
> <br>
> You can do as Tom says, or you can use the gevcdf function with k = 0<br>
> (represents the Gumbel). This will give you the maximum value<br>
> distribution.<br>
<br>
This saved me a ton of time. Thanks!

Thu, 27 Apr 2017 03:26:03 +0000
Re: Data Tip Precision
https://jp.mathworks.com/matlabcentral/newsreader/view_thread/270109#953529
Wen Yu Peng
"George Chen" wrote in message <np90ev$t1e$1@newscl01ah.mathworks.com>...<br>
> "Mike" wrote in message <n24skd$4it$1@newscl01ah.mathworks.com>...<br>
> > "Mike" wrote in message <hvvv7f$ndd$1@fred.mathworks.com>...<br>
> > > "Mike " <michael.moselle@ngc.com> wrote in message <hiicog$pjg$1@fred.mathworks.com>...<br>
> > > > There have been some requests on how to modify the Data Tip precision when you need more decimal places while inspecting plots. The best option to make the default precision change permanently is to modify the 'default_getDatatipText.m' file. On line 31 change the <br>
> > > > DEFAULT_DIGITS = 4;<br>
> > > > to whatever precision you want. Save and this will always be the precision that will be displayed. Happy plotting.<br>
> > > <br>
> > > P.S. The file 'defualt_getDatatipText.m' is located in in your Matlab \toolbox\matlab\graphics\@graphics\@datacursor directory.<br>
> > <br>
> > This function has been discontinued as of Matlab 2014b.<br>
> <br>
> Since it is discontinued from matlab 2014b, is there any way to increase the data precision tip?<br>
<br>
For Matlab 2014b and beyond, here's a permanent method to increase the data tip precision at startup:<br>
<br>
1) First, create any figure and create a cursor datatip. Right click on the datatip and click on "Edit text update function". A new window should pop up with a matlabgenerated "NewCallback" function. I suggest you rename the function into something like "defaultCursorPrecision" and save it in a folder that is accessible by Matlab at startup.<br>
2) Change the second argument of the num2str commands (lines 8, 9, and 13) in the "defaultCursorPrecision" to the desired number of digits of precision.<br>
3) Open "getuimode.m" in the folder ...\toolbox\matlab\uitools with administrator privilege. At the very end add this piece of code:<br>
<br>
if ~isempty(hMode)<br>
hMode.ModeStateData.DataCursorTool.UpdateFcn = @defaultCursorPrecision;<br>
end<br>
<br>
4) Save the changes to "getuimode.m" and now the cursor will display by default the number of digits you specified in "defaultCursorPrecision".

Wed, 26 Apr 2017 20:54:03 +0000
Re: Problem with subs Function
https://jp.mathworks.com/matlabcentral/newsreader/view_thread/348161#953528
Karan Gill
At the end of the loop, you are setting "La" and "Lc" to 0. So, in subsequent iterations, you cannot sustitute for "La" or "Lc" because they are 0. Does that help?<br>
<br>
"Mariam Yehia" wrote in message <och46j$530$1@newscl01ah.mathworks.com>...<br>
> Hello everyone, Here is my program; the problem is that the matlab doesn't substitute the value I put in the functions! and still shows the symbols!!<br>
> the mentioned functions are named: ihr_a and ihr_c<br>
> <br>
> program:<br>
> syms La Lb Lc <br>
> Ia=(20+6*La+.02*La^2);<br>
> Ib=(25+5.5*Lb);<br>
> Ic=(20+6.5*Lc+.005*Lc^2);<br>
> IHRa=diff(Ia,La);<br>
> IHRb=diff(Ib,Lb);<br>
> IHRc=diff(Ic,Lc);<br>
> IHRaIHRc;<br>
> k=0;<br>
> for L=0:10:90<br>
> k=k+1;<br>
> if L<30<br>
> Lb=L;<br>
> else<br>
> Lb=30;<br>
> end<br>
> b=LLb;<br>
> ihr_a=subs(IHRa,La,b)<br>
> ihr_c=subs(IHRc,Lc,b)<br>
> p=ihr_aihr_c<br>
> <br>
> if p<0<br>
> La=LLb;<br>
> Lc=0;<br>
> else Lc=LLb;<br>
> La=0;<br>
> end<br>
> end<br>
> <br>
> Result:<br>
> <br>
> ihr_a =<br>
> <br>
> 6<br>
> <br>
> <br>
> ihr_c =<br>
> <br>
> 6.5000<br>
> <br>
> <br>
> p =<br>
> <br>
> 0.5000<br>
> <br>
> <br>
> ihr_a =<br>
> <br>
> La/25 + 6<br>
> <br>
> <br>
> ihr_c =<br>
> <br>
> Lc/100 + 13/2<br>
> <br>
> <br>
> p =<br>
> <br>
> La/25  Lc/100  1/2<br>
> <br>
> ??? Error using ==> sym.sym>notimplemented at 2653<br>
> Function 'lt' is not implemented for MuPAD symbolic objects.<br>
> <br>
> Error in ==> sym.sym>sym.lt at 812<br>
> notimplemented('lt');<br>
> <br>
> Error in ==> parttwoparallel at 33<br>
> if p<0<br>
>

Wed, 26 Apr 2017 20:40:27 +0000
Re: Search for part of file name
https://jp.mathworks.com/matlabcentral/newsreader/view_thread/289049#953527
dpb
On 04/26/2017 2:43 PM, afef wrote:<br>
> i want the first part of the filenames of 2datasets to create randomfile<br>
>> .How can i do this please?<br>
><br>
> help dir<br>
> Actually i need to specify the first part of the filename and 'dir'<br>
> gives the content of the folder and this is not what i need<br>
<br>
<br>
Didn't you just try it and see?<br>
<br>
<br>
d=dir('abc123*.*');<br>
<br>
Unfortunately, the TMW/Matlab implementation of DIR() doesn't honor the <br>
MS '?' placeholder but the above will work for your simple case.<br>
<br>
You can, of course, always return the full directory list and use string <br>
searching functions and even REGEXP() on the result to your heart's content.<br>
<br>


Wed, 26 Apr 2017 19:43:03 +0000
Re: Search for part of file name
https://jp.mathworks.com/matlabcentral/newsreader/view_thread/289049#953526
afef
i want the first part of the filenames of 2datasets to create randomfile<br>
> .How can i do this please?<br>
<br>
help dir<br>
Actually i need to specify the first part of the filename and 'dir' gives the content of the folder and this is not what i need

Wed, 26 Apr 2017 19:27:03 +0000
Re: Assign values to each row of the matrix
https://jp.mathworks.com/matlabcentral/newsreader/view_thread/348343#953525
James Tursa
"Giorgis" wrote in message <odqqg3$69l$1@newscl01ah.mathworks.com>...<br>
> Hi<br>
> <br>
> I'm trying to assign values to a matrix in the following manner:<br>
> <br>
> Set a matrix 100 x 3<br>
> <br>
> Then for every row assign values in a loop such as row1 = [X ,Y, Z];<br>
> <br>
> This is how I'm trying to solve this unsuccessfully...<br>
> <br>
> listA = [100, 3];<br>
> <br>
> for j=1:100<br>
> k = 10^2;<br>
> hd = k / j;<br>
> listA(j,:,:)= [j, k, hd];<br>
> end<br>
> <br>
> Thanks<br>
<br>
numbers = (1:100)';<br>
k = 10^2;<br>
listA = [numbers, numbers, k./numbers];<br>
listA(:,2) = k;<br>
<br>
James Tursa

Wed, 26 Apr 2017 18:56:03 +0000
Assign values to each row of the matrix
https://jp.mathworks.com/matlabcentral/newsreader/view_thread/348343#953524
Giorgis
Hi<br>
<br>
I'm trying to assign values to a matrix in the following manner:<br>
<br>
Set a matrix 100 x 3<br>
<br>
Then for every row assign values in a loop such as row1 = [X ,Y, Z];<br>
<br>
This is how I'm trying to solve this unsuccessfully...<br>
<br>
listA = [100, 3];<br>
<br>
for j=1:100<br>
k = 10^2;<br>
hd = k / j;<br>
listA(j,:,:)= [j, k, hd];<br>
end<br>
<br>
Thanks

Wed, 26 Apr 2017 18:45:03 +0000
Re: filtfilt function
https://jp.mathworks.com/matlabcentral/newsreader/view_thread/263528#953523
David Camacho Alcocer
"Javier LopezCalderon" wrote in message <hr7je8$3su$1@fred.mathworks.com>...<br>
> "Florian " <sppgwff@brunel.ac.uk> wrote in message <hbhtcr$b1$1@fred.mathworks.com>...<br>
> > Hi,<br>
> > <br>
> > I want to create a 4th order zerophase digital butterworth filter with a cutoff frequency of 10Hz. Sofar I was using:<br>
> > <br>
> > Fs=1000; % sample frequency<br>
> > Fc=10; %cutoff frequency<br>
> > [B,A]=butter(4,Fc/(Fs/2)); <br>
> > signal_filt=filtfilt(B,A,signal);<br>
> > <br>
> > Now, I have two questions:<br>
> > 1. I just read in the help function that the "filter order is double the order of the filter specified by B and A".<br>
> > Does that mean that I am currently using a 8th order zerophase digital butterworth filter with a cutoff of 10Hz??<br>
> <br>
> Yes. And also your cutoff (10 Hz) is at 6db (halfamplitude), not 3db as using filter.m<br>
> <br>
> > <br>
> > 2. Talking about the cutoff frequency. Filtering also in the reverse direction, does this process decrease the defined cutoff fc (10Hz)?<br>
> > <br>
> > Your help for clarification is much appreciated.<br>
> > Thanks<br>
<br>
Hi Javier,<br>
<br>
So, how could we go about it in order to avoid the issues mentioned? For example, how can we compensate (adjust the filter order and cutoff frequency) to make sure that we maintain a 3 dB attenuation? I read in some studies that there are ways to do it, but since I am really new to this field, I have no clue how to go about it. Would you have a suggestion? Maybe you have dealt with the issue in the past. <br>
<br>
Just in case you could offer a solution, I have data in the space domain (meters) and need to apply a "passband" butterwoth filter to maintain wavelengths between 3 and 25 meters. The data is obtained through a vehicle sampling at 24 samples per meter. An applicable standard calls for a filter that does not distort the signal's phase, that maintains 3 dB at the cutoff frequencies (I guess .04 and .33 [1/m]) and an attenuation of 24 dB/octave (I guess this translates to a 4th order filter  second order for the filtfilt function if I understand correctly). <br>
<br>
Thanks in advance for your response.<br>
David

Wed, 26 Apr 2017 17:56:05 +0000
Re: If,elseif,else restart
https://jp.mathworks.com/matlabcentral/newsreader/view_thread/348335#953520
James Tursa
"Loren Shure" wrote in message <odpvgm$867$1@newscl01ah.mathworks.com>...<br>
> "Wade Maxwell" wrote in message <br>
> news:odp32b$7ba$1@newscl01ah.mathworks.com...<br>
> <br>
> This is what i am working with so far.<br>
> <br>
> casenum=input('Type 1 for Xaxis centroid or type 2 for Yaxis centroid of a <br>
> Nth Degree Parabola.')<br>
> <br>
> if casenum==1<br>
> b=input('Please enter the length of the parabola on the xaxis =');<br>
> n=input('Please enter the degree of the parabola function =');<br>
> Xc=((n+1)/(n+2))*(b);<br>
> fprintf('The Xaxis Centroid is %0.2f = \n',Xc)<br>
> elseif casenum==2<br>
> h=input('Please enter the height of the parabola =');<br>
> n=input('Please enter the degree of the parabola function =');<br>
> Yc=(h/2)*((n+1)/(2*n+1));<br>
> fprintf('The Yaxis Centroid is %0.2f = .\n',Yc)<br>
> else<br>
> fprintf('\n')<br>
> disp('please choose 1 or 2')<br>
> disp('This code will be ran again in a few seconds')<br>
> pause(3)<br>
> end<br>
> <br>
> My question is how to make it start over at the original question if the <br>
> user chooses a number other than 1 or 2.<br>
> <br>
> Thanks for the help in advance.<br>
> <br>
> <br>
> Put the check for not 1 or 2 first. With some logic...<br>
> <br>
> while notgoodinput<br>
> input...<br>
> checkinput...<br>
> end<br>
> <br>
> then do your cases...<br>
> <br>
> Loren<br>
> <br>
> <a href="http://blogs.mathworks.com/loren">http://blogs.mathworks.com/loren</a> <br>
<br>
<br>
Another method is to wrap everything in a while loop with appropriate breaks:<br>
<br>
while( true )<br>
<br>
casenum=input('Type 1 for Xaxis centroid or type 2 for Yaxis centroid of a<br>
Nth Degree Parabola.')<br>
<br>
if casenum==1<br>
b=input('Please enter the length of the parabola on the xaxis =');<br>
n=input('Please enter the degree of the parabola function =');<br>
Xc=((n+1)/(n+2))*(b);<br>
fprintf('The Xaxis Centroid is %0.2f = \n',Xc)<br>
break % < ADDED<br>
elseif casenum==2<br>
h=input('Please enter the height of the parabola =');<br>
n=input('Please enter the degree of the parabola function =');<br>
Yc=(h/2)*((n+1)/(2*n+1));<br>
fprintf('The Yaxis Centroid is %0.2f = .\n',Yc)<br>
break % < ADDED<br>
else<br>
fprintf('\n')<br>
disp('please choose 1 or 2')<br>
disp('This code will be ran again in a few seconds')<br>
pause(3)<br>
% NO BREAK IN THIS BRANCH<br>
end<br>
<br>
end<br>
<br>
<br>
This has the advantage that you only have to code your cases once.<br>
<br>
<br>
James Tursa

Wed, 26 Apr 2017 16:50:06 +0000
Re: Search for part of file name
https://jp.mathworks.com/matlabcentral/newsreader/view_thread/289049#953519
Bruce
On Wed, 26 Apr 2017 15:52:03 +0000, afef wrote:<br>
<br>
> "Kirsten" wrote in message <i3ufec$nto$1@fred.mathworks.com>...<br>
>> I'm trying to figure out a way to search for only part of a filename. I<br>
>> have multiple files that have similar components.<br>
>> <br>
>> For example:<br>
>> abc123_5687482 abc124_8914573 abc125_1795362 abc126_7831568<br>
>> <br>
>> I was wondering if there is a way to have MATLAB do a wildcard search<br>
>> to find if file abc123_5687482 exists by only using abc123 as the<br>
>> search. I've tried using exist() and fopen, but neither one of these<br>
>> seem to recognize wildcard inputs.<br>
>> <br>
>> Thanks!<br>
> <br>
> i want the first part of the filenames of 2datasets to create randomfile<br>
> .How can i do this please?<br>
<br>
help dir

Wed, 26 Apr 2017 15:52:03 +0000
Re: Search for part of file name
https://jp.mathworks.com/matlabcentral/newsreader/view_thread/289049#953518
afef
"Kirsten" wrote in message <i3ufec$nto$1@fred.mathworks.com>...<br>
> I'm trying to figure out a way to search for only part of a filename. I have multiple files that have similar components.<br>
> <br>
> For example: <br>
> abc123_5687482<br>
> abc124_8914573<br>
> abc125_1795362<br>
> abc126_7831568<br>
> <br>
> I was wondering if there is a way to have MATLAB do a wildcard search to find if file abc123_5687482 exists by only using abc123 as the search. I've tried using exist() and fopen, but neither one of these seem to recognize wildcard inputs.<br>
> <br>
> Thanks!<br>
<br>
i want the first part of the filenames of 2datasets to create randomfile .How can i do this please?

Wed, 26 Apr 2017 14:15:06 +0000
Re: Double Pendulum Poincare Sections
https://jp.mathworks.com/matlabcentral/newsreader/view_thread/297838#953517
Rahul Kumar
I am trying to get the poincare section for the double pendulum but it is not coming as i found in th eliterature. the logic what i am using is that I have four state variable (theta1, theta2, thetadot1, thetadot2), i am solving the coupled EOM using ode45 and i am defining the plane as theta1 = 0 and checking the condition that thetadot1>0. the moment these conditions are satisfied i am interpolating the other two parameters(theta2 and thetadot2) and plotting it.<br>
<br>
Can any body has idea where i am making mistake or can anybody has the matlab code for this problem or similar problem so that i can look into?

Wed, 26 Apr 2017 13:55:25 +0000
Re: filetr design from estimated trasnfer function
https://jp.mathworks.com/matlabcentral/newsreader/view_thread/348003#953516
Rajiv Singh
see "tfest" in system identification toolbox.<br>
<br>
rajiv<br>
<br>
"Michal Kvasnicka" wrote in message <br>
news:obfsp8$883$1@newscl01ah.mathworks.com...<br>
<br>
Is there any way how to design filter (a,b coeffs) from transfer function <br>
estimated by "tfestimate"?

Wed, 26 Apr 2017 12:51:03 +0000
Re: Java Exception Object
https://jp.mathworks.com/matlabcentral/newsreader/view_thread/160176#953515
Morrie Gasser
Sorry, Yair, I didn't mean to imply you can catch Java exceptions that occur in any arbitrary thread. Of course you can't. I just meant to note that the new JavaException class I was referring to gives you access to the actual Java exception object that you couldn't get before.

Wed, 26 Apr 2017 12:47:04 +0000
Re: binblockread not timing out
https://jp.mathworks.com/matlabcentral/newsreader/view_thread/348312#953514
dave9
Solution found!<br>
<br>
This is apparently a common problem with Agilent oscilloscopes attached to USB 3.0 ports. Attaching the oscilloscope to a a powered USB 2.0 hub solved this problem.