http://www.mathworks.com/matlabcentral/answers/questions.atomMATLAB Answers — New Questions2016-02-05T22:15:38Ztag:www.mathworks.com,2005:Question/2658002016-01-29T18:58:18Z2016-02-05T22:15:38ZHello, I am doing optimisation of a guassian function to calculate the midpoint and spread when the function below goes to zero. But when using fminsearch i get negative values.What i am supposed to get is 24 and 4 respectively please help!!<pre class="language-matlab">AA=1.580740308;
BB=0.854284221;
format long g
</pre><pre> invalues=[1,10];</pre><pre> fun1=@(x)((AA-sum(A.*real(exp(-((E-x(1)).^2/x(2).^2)))))^2+...
(BB-sum(B.*real(exp(-((E-x(1)).^2/x(2).^2)))))^2);</pre><pre> [x,fval]=fminsearch(fun1,invalues)</pre>percy van http://www.mathworks.com/matlabcentral/profile/authors/7590338-percy-vantag:www.mathworks.com,2005:Question/2667182016-02-05T03:07:05Z2016-02-05T22:13:45ZHow would I manually perform an integral in MATLAB?<p>My professor has told us not to use the integral3 function in matlab to solve a triple integral. He explained to me today that I should use a nested loop in order to do what we normally would do with an integral. I can't seem to figure out how to do this in matlab. Below I've provided the integral in question that I'm trying to solve as well as my code that I have currently. When I run the code below I get back 18y+54z+6 when the answer should be 16.</p><p>∭∇·F dV where dV is dx*dy*dz and the bounds for all three are from -1 to 1.</p><p>syms x y z</p><p>f = 2*x+y^2+z^2;</p><p>fx = diff(f,x)
fy = diff(f,y)
fz = diff(f,z)</p><p>F = fx+fy+fz</p><p>sum = 0;
dx = 1;
for x = -1:dx:1
sum = sum + fx*dx
for y = -1:dx:1
sum = sum + fy*dx
for z = -1:dx:1
sum = sum+fz*dx
end
end
end</p><p>Thank you for any help you might be able to provide!</p>William Downinghttp://www.mathworks.com/matlabcentral/profile/authors/6082606-william-downingtag:www.mathworks.com,2005:Question/2668412016-02-05T21:31:19Z2016-02-05T22:12:43ZProblem with huge epinions data-set<p>Hello everyone.
I have epinions data-set that has 124000 users and 750000 items.
Im implementing recommendation system to solve cold start problem.
In first phase I should change the data-set to M-dimensional format.
M is total number of items.
It means 124000 rows and 750000 cols. Its really huge data-set.
I used zeros(124000,750000),
But memory problem occurred.
I used sparse(124000,750000),
It was ok but the process to fill the matrix takes about 2 days to finish (because of huge dimensional of dataset).
What can I do now ? The next phase is performing K-means clustering on this M-dimensional data-set.
Thanks</p>shayan asadpoorhttp://www.mathworks.com/matlabcentral/profile/authors/5110981-shayan-asadpoortag:www.mathworks.com,2005:Question/2668442016-02-05T21:54:20Z2016-02-05T22:09:40ZPlotted a 3D distribution of points in XYZ plane, I see that some points are grouped together in denser regions...<p>Is there a way to divide the axes into small box volumes, count the number of points in each little box volume, and hence determine the density of each box region via how many points are actually in the box?</p><p>Thanks I am very new to matlab and trying to identify dense spots in my plotted data.</p>LMagwoodhttp://www.mathworks.com/matlabcentral/profile/authors/7626551-lmagwoodtag:www.mathworks.com,2005:Question/2647742016-01-22T09:33:07Z2016-02-05T22:09:26ZReal time classification problem<p>I have data of two different classes (attached xls file) blue is belongs to one class and red is belongs to another class.
I need to classify the future real time inputs based on this data.
Please suggest me simple classification technique which can be implemented easily in a microcontroller to do this classification task.</p>HST20http://www.mathworks.com/matlabcentral/profile/authors/7305008-hst20tag:www.mathworks.com,2005:Question/318912012-03-11T14:52:55Z2016-02-05T21:52:44ZHungary algorithm<p>Is there in MATLAB function for Hungary algorithm
Thanks</p>Aldinhttp://www.mathworks.com/matlabcentral/profile/authors/3117839-aldintag:www.mathworks.com,2005:Question/2664582016-02-03T15:21:04Z2016-02-05T21:50:05ZHow to plot y = C*expm(A*t)*B?<p>How to plot y = C*expm(A*t)*B, where A,B and C are matrices? I tried defining t=linspace(0,100,25) and then calculate y as function (as defined) and I got message about dimension error.</p>Ljixhttp://www.mathworks.com/matlabcentral/profile/authors/7612956-ljixtag:www.mathworks.com,2005:Question/2667932016-02-05T13:09:11Z2016-02-05T21:39:56Zhello,on the execution of ("C: \ ANSYS Inc \ v130 \ ansys \ bin \ winx64!" -b -i feain.txt feaout.txt -O) the matlab appears: "C: \ ANSYS Inc \ v130 \ ansys \ bin \ winx64 "'n? is not recognized as an internal control or external excutable a program <p>hello,on the execution of ("C: \ ANSYS Inc \ v130 \ ansys \ bin \ winx64!" -b -i feain.txt feaout.txt -O) the matlab appears: "C: \ ANSYS Inc \ v130 \ ansys \ bin \ winx64 "'n? is not recognized as an internal control or external excutable a program</p>amina lkhttp://www.mathworks.com/matlabcentral/profile/authors/5411304-amina-lktag:www.mathworks.com,2005:Question/2668042016-02-05T14:49:13Z2016-02-05T21:38:56ZHow to convert into double?<p>Hello,</p><p>I wrote the following code:</p><pre class="language-matlab">tfail = [5571.760,5573.742,5654.457,6079.693,6081.927,6172.915,6515.064,6517.515,6617.308,7095.558,7098.298,7209.831,7530.929,7533.885,7654.224,7966.300,7969.472,8098.617,8401.671,8405.059,8543.009,8982.166,8985.843,9135.533,9852.908,9857.017,10024.38,10868.774,10873.387,11061.234];
n=length(tfail);
</pre><pre class="language-matlab">beta_hat = 4.2915822;
B_hat = 1861.6186657;
C_hat = 58.9848692;
</pre><pre class="language-matlab">syms t B beta C
y(t) = (exp(-B/((heaviside(t)-heaviside(t-2000))*(330)+(heaviside(t-2000)-heaviside(t-3000))*(350)+...
(heaviside(t-3000)-heaviside(t-14000))*(390))))/C;
</pre><pre class="language-matlab">ogL=0;
</pre><pre class="language-matlab">for i=1:n
tfail(i);
I(i) = int(y(t),t,0,tfail(i));
y_new(i)=subs(y,t,tfail(i));
logL =logL+log((beta*y_new(i)*(I(i))^(beta-1))*exp(-((I(i))^beta)));
end
</pre><pre class="language-matlab">p = int(y(t),t,0,14000);
u = beta*log(p);
du_dB = diff(u,B);
du_dbeta = diff(u,beta);
du_dC = diff(u,C);
du_dB_sub = subs(du_dB,{beta,B,C},{beta_hat,B_hat,C_hat});
du_dbeta_sub = subs(du_dbeta,{B,C},{B_hat,C_hat});
du_dC_sub = subs(du_dC,{beta,B,C},{beta_hat,B_hat,C_hat});
</pre><pre class="language-matlab">v=[beta;B;C];
H=hessian(logL,v);
H_negatv=-1*H;
</pre><p>now I would like to calculate the inverse of H_negatv by using:</p><pre class="language-matlab">H_inverse=inv(H_negatv);
</pre><p>But that doesn´t work. So I tried out:</p><pre class="language-matlab">h = 1\H_negatv.
</pre><p>That´s good so far.</p><p>But now I would do sth. like that:</p><pre class="language-matlab">w=subs(h,[beta,B,C],[beta_hat,B_hat,C_hat]);
F_direct = w;
</pre><p>In according to calculate:</p><pre class="language-matlab">Var_B_hat_direct = double(F_direct(2,2));
</pre><p>But I can´t do that in MATLAB.</p><p>Does somebody have an idea how to solve that problem?</p>Maxhttp://www.mathworks.com/matlabcentral/profile/authors/4346765-maxtag:www.mathworks.com,2005:Question/2668422016-02-05T21:34:45Z2016-02-05T21:34:45ZTimer Callback Function Variable period<p>Hi,</p><p>I have successfully built is timer callback function in matalb to control my stepper motor. The period in my timer function is currently a constant and doesnt change.
t.Period = timestep;</p><p>Is it possible to change the period, or the variable 'timestep' while my timer is running?</p><p>For example, if I have 20 steps to execute I want my 'timestep' to be an array of 20 with different times for each execution?</p><p>Is it possible to have the period changing from one execution to the other?</p><p>Cheers</p><p>Farid</p>Farid Samarahttp://www.mathworks.com/matlabcentral/profile/authors/7251053-farid-samaratag:www.mathworks.com,2005:Question/2668392016-02-05T19:52:37Z2016-02-05T21:27:16Zsort a matrix based on a maximum value in each row<p>I have a matrix that I first determined the max value in each row and its row index.
now I need to sort the whole matrix in descendant order based on the maximums identified from the row with the larget max to the row with smallest max. example:
A=[0 1 2 1 1; 0 4 3 1 2; 1 2 0.5 3 5] ( matrix is 3*5.
so first I need to identify the Max in each row and its index. so now it [2; 4; 5] then I need to reorder the matrix/ all the rows based on descendant order, so first row is the one with the highest max:
SortedMatrix=[ 1 2 0.5 3 5;0 4 3 1 2;0 1 2 1 1];
any suggestions? please.</p>Amine Ben Ayara http://www.mathworks.com/matlabcentral/profile/authors/6651884-amine-ben-ayaratag:www.mathworks.com,2005:Question/2659842016-02-01T01:35:25Z2016-02-05T21:22:08Zhow can i find the best ann architecture?<p>i need some help for building the best performance ann architecture for rainfall forecasting in a village in indonesia with 360 data (months in 30 years). First of all i am a beginner in ann also matlab, i just have a brief understanding of them, just a little bit. iam using nntool in matlab for processing (gui version), i dont even know how to get the syntax from the nntool gui in command window, why am i not using time series ann tools? because its to complicated, just need the simple net to process. Here is the problems and questions:</p><p>1.i have a problem for initializing or preparing the data, i.e iam using 2x120 input matrices with 2 inputs and 120 variables, and 1x120 for data target, i just want to predict the data in the next 1 year (it will be 12 data in months), all of the data is rainfall data. My understanding and logic of that kind of data construction is like this "if we have 360 data, and have 2 inputs variables, just divide the data into 3 so it can have same data samples for inputs and targets (cause i think that data target samples must be equal with the input samples), is that logic correct or wrong? just need to know how to prepare our data.</p><p>2.the training test of that architecture is really bad (using default training parameters) the mse is around 10^3-10^4, before that i have some questions, is it the performance value in training gui (nntraintool) at the progress table shows the real mse of ann performance? cause i just assume it like that, or if its wrong, how can i get the mse? I just need the mse, the %error and the predicted data for the final conclusion. what is probably the best training parameter for rainfall data (seasonal data)?enter image description here</p><p>3.next question is already mentioned in above, is it possible to shows or create the code or syntax from nntool gui? and if it yes how?</p><p>for the number of input's nodes, iam using the lagged correlation from the time series scatter plots of the data when it achieve the stasionary (the significant ACF and PACF) and the data divides for training, test and validation using random. iam sorry for my bad explanation (and also english) hope everyone could understand it. Thank you.</p>Gede Sukrisnhahttp://www.mathworks.com/matlabcentral/profile/authors/7594815-gede-sukrisnhatag:www.mathworks.com,2005:Question/2339282015-08-14T19:16:49Z2016-02-05T21:09:45ZMATLAB Answers Wish-list #4 (and bug reports)<p>This topic is for features you would like to see for the MATLAB Answers facility itself, and also for bug reports about the MATLAB Answers facility.</p><p>This topic is the follow on to the first <a href = "http://www.mathworks.com/matlabcentral/answers/994">Wish-list for MATLAB Answer sections</a> and second <a href = "http://uk.mathworks.com/matlabcentral/answers/42413-matlab-answers-wish-list-2-and-bug-reports">MATLAB Answers Wish-list #2 (and bug reports)</a>. Those grew large enough to become unwieldy; and Mathworks has made enough changes to make a number of the past points no longer of relevance. More recently there was the limited purpose <a href = "http://uk.mathworks.com/matlabcentral/answers/216662-new-design-of-the-forum-grey-on-white-wish-list-3-bug-reports">New design of the forum - grey on white</a> which turned into a bug and wish list; I have renamed that for continuity.</p><p>I suggest one wish (or bug report) per answer, so that people can vote their wishes.</p>Walter Robersonhttp://www.mathworks.com/matlabcentral/profile/authors/434782-walter-robersontag:www.mathworks.com,2005:Question/2664422016-02-03T13:27:25Z2016-02-05T22:09:37ZHow can I calculate this triple integral when I have a rotated euler matrix. All that is attached in the file,<pre class="language-matlab">function C_ij = VoigtModelFunction
</pre><pre class="language-matlab">Cs_kl = [250, 88.3, 87.5, 0, 0, 0 ; ...
88.3, 250, 87.5, 0, 0, 0 ; ...
87.5, 87.5, 92, 0, 0, 0 ; ... %for example(6x6)
0, 0, 0, 22.7, 0, 0 ; ...
0, 0, 0, 0, 22.7 0 ; ...
0, 0, 0, 0, 0, 82.20];
alpha = 0.15235;
if nargin == 0
euler = randBunges;
end
</pre><pre class="language-matlab">euler = euler/180*pi;
phi1 = euler(1);
phi2 = euler(2);
Phi = euler(3);
</pre><pre class="language-matlab">alpha=0.15235
</pre><pre class="language-matlab">Crot= MS_rotEuler(Cs_kl,phi1,Phi,phi2);
</pre><pre class="language-matlab">VoigtModel = @(phi1, phi2, phi)Crot*ODF_W_function(phi2, alpha).*sin(phi2(i));
</pre><pre class="language-matlab">C_ij =Crot.*integral3(VoigtModel,0,2*pi,0,2*pi,0,pi);
</pre><pre class="language-matlab">end
>> VoigtModelFunction
</pre><pre class="language-matlab">alpha =
</pre><pre> 0.1524</pre><pre class="language-matlab">CC =
</pre><pre> 250.0529 88.2460 87.5006 0.0157 -0.2066 -0.2595
88.2460 249.9560 87.5318 2.3906 0.0042 0.2677
87.5006 87.5318 92.0344 0.8356 -0.0703 -0.0026
0.0157 2.3906 0.8356 22.7319 -0.0006 -0.0967
-0.2066 0.0042 -0.0703 -0.0006 22.7250 1.2140
-0.2595 0.2677 -0.0026 -0.0967 1.2140 82.1214</pre><pre class="language-matlab">Assignment has more non-singleton rhs dimensions than non-singleton subscripts
</pre><pre class="language-matlab">Error in ODF_W_function (line 32)
W(:,ii) = (1./(alpha(ii)*((2*pi).^0.5))) * ...
</pre><pre class="language-matlab">Error in VoigtModelFunction>@(phi1,phi2,phi)Crot*ODF_W_function(phi2,alpha).*sin(phi2(i)) (line 25)
VoigtModel = @(phi1, phi2, phi)Crot*ODF_W_function(phi2, alpha).*sin(phi2(i));
</pre><pre class="language-matlab">Error in integral3>@(y,z)FUN(x(1)*ones(size(z)),y,z) (line 138)
@(y,z)FUN(x(1)*ones(size(z)),y,z), ...
</pre><pre class="language-matlab">Error in integral2Calc>integral2t/tensor (line 228)
Z = FUN(X,Y); NFE = NFE + 1;
</pre><pre class="language-matlab">Error in integral2Calc>integral2t (line 55)
[Qsub,esub] = tensor(thetaL,thetaR,phiB,phiT);
</pre><pre class="language-matlab">Error in integral2Calc (line 9)
[q,errbnd] = integral2t(fun,xmin,xmax,ymin,ymax,optionstruct);
</pre><pre class="language-matlab">Error in integral3/innerintegral (line 137)
Q1 = integral2Calc( ...
</pre><pre class="language-matlab">Error in integralCalc/iterateScalarValued (line 314)
fx = FUN(t);
</pre><pre class="language-matlab">Error in integralCalc/vadapt (line 132)
[q,errbnd] = iterateScalarValued(u,tinterval,pathlen);
</pre><pre class="language-matlab">Error in integralCalc (line 75)
[q,errbnd] = vadapt(@AtoBInvTransform,interval);
</pre><pre class="language-matlab">Error in integral3 (line 121)
Q = integralCalc(@innerintegral,xmin,xmax,integralOptions);
</pre><pre class="language-matlab">Error in VoigtModelFunction (line 27)
C_ij =Crot.*integral3(VoigtModel,0,2*pi,0,2*pi,0,pi);
</pre>Anouar CHAABANIhttp://www.mathworks.com/matlabcentral/profile/authors/7613293-anouar-chaabanitag:www.mathworks.com,2005:Question/2668162016-02-05T16:19:05Z2016-02-05T20:36:01ZHow to programmatically get custom MATLAB toolbox version?<p>I have created my own toolbox and packaged it into a .mltbx file. Inside the toolbox, I want to include a function that returns the current version of the toolbox installed on the user's computer. Is there a way to do extract this information programmatically from either the .mltbx file or .prj file?</p>Matt Eicholtzhttp://www.mathworks.com/matlabcentral/profile/authors/3529521-matt-eicholtztag:www.mathworks.com,2005:Question/2668382016-02-05T19:35:37Z2016-02-05T20:18:43ZHow to find min and max of a text file full of numbers?<p>I am trying to figure out how to find a specific value in a text file such as being able to find a min and max by MATLAB reading a .txt and finding the max / min values.</p>Kurtis2821http://www.mathworks.com/matlabcentral/profile/authors/7561355-kurtis2821tag:www.mathworks.com,2005:Question/2666712016-02-04T18:47:08Z2016-02-05T20:10:27ZI have a code on integration closed form.I have got the answer in terms of hypergeometric function. please explain about the solution what it actually means in simple way.A short description about the solution..Please help me.Its very much needful <pre class="language-matlab">syms a x y clear
f = y/(y + x^(a/2));
F = int(f, x, 1, inf);
vpa(F, 5)
int(f, x, 'IgnoreSpecialCases', true)
</pre><p>Solution is:</p><pre class="language-matlab">ans =
numeric::int(y/(y + x^(a/2)), x == 1..Inf)
</pre><pre class="language-matlab">ans =
x*hypergeom([1, 2/a], [2/a + 1], -x^(a/2)/y)
</pre>Swapna Havalgihttp://www.mathworks.com/matlabcentral/profile/authors/7025175-swapna-havalgitag:www.mathworks.com,2005:Question/2666532016-02-04T16:53:19Z2016-02-05T20:00:07ZHow do I collect all data strings of an array that meet 2 criteria <p>I am trying to collect data from an array that meet two criteria. More specifically, I want to start collecting the values of an array that cross a threshold and continue to collect the values in the array until they fall below another threshold. I can do the first part, but I can't figure out how to continue to collect the values until they fall below the second threshold (ThresholdOFF in the below attempt). Can you help me collect continuous values of the array (x) that cross above Threshold and continue to collect until the next value that falls below ThresholdOFF? Then I want the indices of the values that meet these criteria. Here is what I have so far:</p><pre> Fs = 8000; % samples per second
dt = 1/Fs; % seconds per sample
StopTime = 0.25; % seconds
t = (0:dt:StopTime-dt)'; % seconds
%% Sine wave:
Fc = 60; % hertz
x = cos(2*pi*Fc*t);
% Plot the signal versus time:
figure;
plot(t,x);
xlabel('time (in seconds)');
title('Signal versus Time');
zoom xon;
%%
StDevPower=std(x);
MeanPower=mean(x);
Threshold=((StDevPower*1)+MeanPower);
ThresholdOFF=((StDevPower*0.5)+MeanPower);</pre><pre> AboveSD=[];
for j=1:length(x)
if x(j)>Threshold
AboveSD=[AboveSD; x(j)];
end
end
figure, plot(AboveSD)</pre>Georgia http://www.mathworks.com/matlabcentral/profile/authors/4489884-georgiatag:www.mathworks.com,2005:Question/2668402016-02-05T19:54:28Z2016-02-05T19:54:28ZHello, is it possible to number each cell and color each cell when the number for cell is provided? Also, the 3D figure with cells look like the image attacaehd. <img src = "/matlabcentral/answers/uploaded_files/44826/3D%20cells%5D.PNG">Bimal Punhttp://www.mathworks.com/matlabcentral/profile/authors/7435910-bimal-puntag:www.mathworks.com,2005:Question/2668352016-02-05T18:55:54Z2016-02-05T19:43:07ZDisplay a struct as a table<p>Hi all,</p><p>I have a struct. I want to display the content of this struct as a table. So I use the following transformation.</p><pre> aTable = struct2table(aStruct);
disp(aTable);</pre><p>We can see the value of modifiedTime is not correct. I hope to display it as a value, not as an array. Can you tell me how I can do it?</p><p>Thanks.</p><p>aStruct =</p><pre> LocalName: {'example.cdf'}
Size: '1 KB'
ModifiedTime: '10-May-2010 21:35:00'</pre><pre> LocalName Size ModifiedTime
_____________ ____ ____________</pre><pre> 'example.cdf' 1 KB [1x20 char] </pre>Yanghttp://www.mathworks.com/matlabcentral/profile/authors/6246546-yangtag:www.mathworks.com,2005:Question/2667902016-02-05T12:44:19Z2016-02-05T19:28:07ZQuestion about convolution of two discrete random variable<p>There is poisson random variable X with T*lambda_MUE.</p><p>There is poisson random variable Z with lambda_SMC.</p><p>And i define new random variable K=aX+bZ. (a and b is positive integer which is greater than 0)</p><p>To calculate pmf of K i used conv function.</p><p>And calculate using below command but it is not equal to E[K]</p><p>What i expect is 123 but result is 43 .</p><p>What is wrong?</p><p>Thank you</p><pre class="language-matlab">lambda_MUE = 2;
lambda_SMC = 3;
alpha = 3;
beta = 1;
T=20;
g=alpha*(0:1:110);
z=beta*(0:1:110);
K=0:1:(max(g)+max(z));
P_X = ((T*lambda_MUE).^(g/alpha))./(factorial(g./alpha)).*exp(-T*lambda_MUE);
P_Z = (lambda_SMC.^(z./beta))./(factorial(z./beta)).*exp(-lambda_SMC);
P_K = conv(P_X,P_Z);
sum(K(1:1:length(P_K)).*P_K)
</pre>h kimhttp://www.mathworks.com/matlabcentral/profile/authors/7069670-h-kimtag:www.mathworks.com,2005:Question/2544942015-11-12T16:36:52Z2016-02-05T19:26:56ZError: "Undefined variable 'LibraryBrowser' or class 'LibraryBrowser.StandaloneBrowser'" after migrating from MATLAB R2012a to R2015b<p>Hello guys,</p><p>When using the Simulink Library Browser, I often have to refresh libraries. Luckily, a colleague wrote a nifty callback function which takes care of just that. With Matlab R2012a, the code works just fine.
But I ran into the problem mentioned in the title when using the same code with a freshly installed Matlab R2015b.</p><p>By googleing the "variable" "LibraryBrowser" I only found a few threads in which the usage of this also recommended.
This one, for instance: <a href = "http://de.mathworks.com/matlabcentral/answers/182922#answer_171182">http://de.mathworks.com/matlabcentral/answers/182922#answer_171182</a></p><p>However, I did not find any explanation or API in which the usage of this is explained or documented.</p><p>So my question is, since the usage of this was recommended from multiple sources:
Is the variable not supported anymore? Or does anyone has an idea as to why it does not work with the newest version of Matlab?</p><p>The code I work with is also responsible for refreshing the current window and does a bit more than that. The callback is designed so it will be executed by pressing "F8" or by clicking "Simulink Library Browser -> View -> Refresh Selected Library"</p><p>But by doing so, the error "Undefined variable 'LibraryBrowser' or class 'LibraryBrowser.StandaloneBrowser'" occurs.</p><p>This is a part of the code:</p><pre class="language-matlab">function [] = RefreshSelectedLibrary(callbackInfo)
% Callback-function for refreshing the seleceted library.
</pre><pre> import System.Text.RegularExpressions.*;</pre><pre> libraryBrowser = LibraryBrowser.StandaloneBrowser; *%breaks here*
%...</pre><pre> % Refresh library browser
libraryBrowser.refreshLibraryBrowser;</pre><pre> % Collapse currrent tree node
currentTreeNode = libraryBrowser.getCurrentTreeNode;
libraryBrowser.collapseTreeNodeByName(currentTreeNode);</pre><pre> % Select and expand library
libraryBrowser.selectTreeNodeByName(selectedTreeItem);
libraryBrowser.expandTreeNodeByName(selectedTreeItem);</pre><pre class="language-matlab">end
</pre>Andreas Muellerhttp://www.mathworks.com/matlabcentral/profile/authors/2243038-andreas-muellertag:www.mathworks.com,2005:Question/2668022016-02-05T14:34:43Z2016-02-05T19:23:36ZHow to apply a quantization step to a 2D transformed image?<p>Hi all of you,
I need some help here, my problem is how can i use quantization to the result of that code below?,knowing that the result (XDFT) is complex arry, example:
XDFT(1,1)=125+ i*2562.
So how values like XDFT(1,1) will be on an interval between 0 and 255.</p><pre> [filename, pathname] = uigetfile('*.bmp', 'open image');% getting a Bitmap image.
[X,MAP]=imread(fullfile(pathname, filename));%Image reading.
R=input('R=');%bloc size(8*8 or 16*16 or 32*32).
XDFT= blkproc(X,[R R],'fft2');%DFT Transformation of X.</pre>Mr. BOUREZGhttp://www.mathworks.com/matlabcentral/profile/authors/2833188-mr-bourezgtag:www.mathworks.com,2005:Question/2667512016-02-05T07:37:06Z2016-02-05T19:20:34ZIs it possible to delete the Simulink (R2014b) browser history (back/forward/up to parent) of a model without restarting MATLAB?<p>Problem:
We observe a strong decrease of browsing performance with large models when several browse steps were saved in the history.
Performance is good again after restarting MATLAB.</p>apbhttp://www.mathworks.com/matlabcentral/profile/authors/735723-apbtag:www.mathworks.com,2005:Question/2667142016-02-05T01:51:40Z2016-02-05T19:16:00ZWant to find the angle between edges of image<p>I want to ask how one can get the angle between two edges in an image ?</p>Jyotiraditya Singhhttp://www.mathworks.com/matlabcentral/profile/authors/7622713-jyotiraditya-singhtag:www.mathworks.com,2005:Question/2667892016-02-05T12:35:42Z2016-02-05T19:14:09Zhow to get max, min and avg of a field of a structure in a cell matrix<p>Hi</p><p>I have a cell matrix consisting of 3 columns and 400 rows. Every entry in this matrix is a structure. Lets say three columns are A, B and C. Column A contains same structure StructureA, Column B contains same structure StructureB, Column C contains same structure StructureC in all rows. Let say StructureC contains 4 fields field1, field2, field3 and field4.</p><ol><li>I want to find max and min value of field3 across all rows in column C.</li><li>Then I want to find out which row of ColumnC contains max value and which row contains min value of field3.</li><li>Then I want to find out the average of field3 across all rows in ColumnC.</li><li>Finally I want to get all the rows where field3 equals to some value, such as get all the rows where field3 = 'abc' in ColumnC.</li></ol><p>I have already tried below code to calculate the max value but it did not work</p><pre class="language-matlab">maxField3 = max(Column3{:,3}.field3)
</pre><p>I don't want to use loop for calculating these things. Please help.</p><p>Thanks in advance.</p>Anil Vermahttp://www.mathworks.com/matlabcentral/profile/authors/6858268-anil-vermatag:www.mathworks.com,2005:Question/1021302011-11-16T14:56:00Z2016-02-05T19:11:06ZHow do I check MISRA AC AGC rules with Polyspace?<p>I have generated some C code using a code generator and I would like to check the code for its compliancy with MISRA AC AGC using Polyspace rules checker.</p>MathWorks Support Teamhttp://www.mathworks.com/matlabcentral/profile/authors/4622813-mathworks-support-teamtag:www.mathworks.com,2005:Question/2639512016-01-15T21:33:09Z2016-02-05T19:09:06ZNeural Networks change the Target<p>Hello.
I have the next Question.
After the training. How can I make the Neural Network works?
Example: I train the NN, after that I make run the NN and have a result, but now I need change the Target and found a result whit the new Target without to train again?.
Can yours make a example.??</p><p>Thank you</p><p>Andrew</p>ANDRES CONSIGLIOhttp://www.mathworks.com/matlabcentral/profile/authors/6513340-andres-consigliotag:www.mathworks.com,2005:Question/2668372016-02-05T19:02:21Z2016-02-05T19:02:21ZRaspberry Pi camera - how to set shutter speed with cameraboard object<p>How can I set the shutter speed/exposure time using a raspi cameraboard object? I'm looking for the equivalent of</p><p>raspistill -ss 20000, for example (set shutter speed to 20 ms)</p><p>rpi = raspi();
cam = cameraboard(rpi);
cam.ShutterSpeed = 20000; % example of what I'd like to do</p>Optics Guyhttp://www.mathworks.com/matlabcentral/profile/authors/3249821-optics-guytag:www.mathworks.com,2005:Question/2668362016-02-05T05:00:00Z2016-02-05T18:57:02ZHow do I fit a function to 4D or ND data?<p>I have a mapping from N>3 inputs to one output specified in input-output pairs. How can I create a function from these data that I can use for plotting or as input to functions like "fmincon"? I don't know anything about the form or the function I want to fit.</p>MathWorks Support Teamhttp://www.mathworks.com/matlabcentral/profile/authors/4622813-mathworks-support-teamtag:www.mathworks.com,2005:Question/2668062016-02-05T15:07:01Z2016-02-05T18:54:53ZHow can I get my script to accept a user input in the form of a vector? <p>I want users to be able to input a series of letters and then display the numerical values I have pre-assigned each letter.
Specifially, the input would be an amino acid sequence. Each amino acid is pre-assigned values based on their chemical properties. I need to be able to display and sum these values from any given sequence.</p><p>As I'm new to matlab, any help will be greatly appreciated!</p>Natalie Hhttp://www.mathworks.com/matlabcentral/profile/authors/7488725-natalie-htag:www.mathworks.com,2005:Question/2648552016-01-22T21:30:31Z2016-02-05T18:54:18ZError using mex (no description of error)<p>Hey all,</p><p>So I'm trying to compile an example .c program from <a href = "http://www.mathworks.com/help/matlab/matlab_external/install-mingw-support-package.html">http://www.mathworks.com/help/matlab/matlab_external/install-mingw-support-package.html</a> and I get the following message:</p><pre class="language-matlab">>> mex yprime.c
</pre><pre class="language-matlab">Building with 'MinGW64 Compiler (C)'.
</pre><pre class="language-matlab">Error using mex
</pre><p>With no other description... I don't even know where to start looking.</p>Christopher Davishttp://www.mathworks.com/matlabcentral/profile/authors/6631168-christopher-davistag:www.mathworks.com,2005:Question/2668262016-02-05T17:44:08Z2016-02-05T18:53:34ZHow to get 2 variables form loading mat fille<p>I want to load lots of mat file like (a1_2.mat......a50_40.mat) and take two variables(c,d) from each mat file and then put variables in a matrix like this.[c1 d1; c2 d2.....]</p><pre> for n = 1 : 50
for k=1:40
y=load(['a',num2str(n),'_', num2str(k) '.mat']);
c = y.c;% load first variable
d=y.d; % load second variable and </pre><pre> all(:,1)=c;
all(:,2)=d;</pre><pre> end
end</pre><p>but I can't get the final matrix correctly.</p><p>Thanks in advance for your help.</p>Ritahttp://www.mathworks.com/matlabcentral/profile/authors/3883383-ritatag:www.mathworks.com,2005:Question/2668132016-02-05T15:53:03Z2016-02-05T18:43:44ZI want to divide an image into 25 equal tiles with the help of for loop...<p>I've done it with my basic knowledge but its very large code plz help me out to convert it into for loop
my code is as follow,</p><p>_ _ _ _</p><img src = "/matlabcentral/answers/uploaded_files/44818/demo.JPG"><p><i>__</i></p><pre class="language-matlab">aj=imread('cameraman.tif'); %Image contains my real time edge detected picture but here taken Cameraman as an example
[h w]=size(aj)
wm=floor(w/5);
hm=floor(h/5);
figure;
aj1=aj(1:hm,1:wm,:);
subplot(5,5,1);imshow(aj1);
aj2=aj(1:hm,wm:2*wm,:);
subplot(5,5,2);imshow(aj2);
aj3=aj(1:hm,2*wm:3*wm,:);
subplot(5,5,3);imshow(aj3);
aj4=aj(1:hm,3*wm:4*wm,:);
subplot(5,5,4);imshow(aj4);
aj5=aj(1:hm,4*wm:5*wm,:);
subplot(5,5,5);imshow(aj5);
aj6=aj(hm:2*hm,1:wm,:);
subplot(5,5,6);imshow(aj6);
aj7=aj(hm:2*hm,wm:2*wm,:);
subplot(5,5,7);imshow(aj7);
aj8=aj(hm:2*hm,2*wm:3*wm,:);
subplot(5,5,8);imshow(aj8);
aj9=aj(hm:2*hm,3*wm:4*wm,:);
subplot(5,5,9);imshow(aj9);
aj10=aj(hm:2*hm,4*wm:5*wm,:);
subplot(5,5,10);imshow(aj10);
aj11=aj(2*hm:3*hm,1:wm,:);
subplot(5,5,11);imshow(aj11);
aj12=aj(2*hm:3*hm,wm:2*wm,:);
subplot(5,5,12);imshow(aj12);
aj13=aj(2*hm:3*hm,2*wm:3*wm,:);
subplot(5,5,13);imshow(aj13);
aj14=aj(2*hm:3*hm,3*wm:4*wm,:);
subplot(5,5,14);imshow(aj14);
aj15=aj(2*hm:3*hm,4*wm:5*wm,:);
subplot(5,5,15);imshow(aj15);
aj16=aj(3*hm:4*hm,1:wm,:);
subplot(5,5,16);imshow(aj16);
aj17=aj(3*hm:4*hm,wm:2*wm,:);
subplot(5,5,17);imshow(aj17);
aj18=aj(3*hm:4*hm,2*wm:3*wm,:);
subplot(5,5,18);imshow(aj18);
aj19=aj(3*hm:4*hm,3*wm:4*wm,:);
subplot(5,5,19);imshow(aj19);
aj20=aj(3*hm:4*hm,4*wm:5*wm,:);
subplot(5,5,20);imshow(aj20);
aj21=aj(4*hm:5*hm,1:wm,:);
subplot(5,5,21);imshow(aj21);
aj22=aj(4*hm:5*hm,wm:2*wm,:);
subplot(5,5,22);imshow(aj22);
aj23=aj(4*hm:5*hm,2*wm:3*wm,:);
subplot(5,5,23);imshow(aj23);
aj24=aj(4*hm:5*hm,3*wm:4*wm,:);
subplot(5,5,24);imshow(aj24);
aj25=aj(4*hm:5*hm,4*wm:5*wm,:);
subplot(5,5,25);imshow(aj25);
</pre>Ajinkya Paikekarihttp://www.mathworks.com/matlabcentral/profile/authors/5286654-ajinkya-paikekaritag:www.mathworks.com,2005:Question/1667812014-12-16T08:22:37Z2016-02-05T18:41:49ZHelp to get a Overrun detection function for texas Instruments Microcontrollers <p>Dear friends,</p><p>I am using Embebbed Coder to compilate a simulink code into a Texas Instruments Microcontroller (Delfino 28335 MCU).</p><p>I would like to get a way to detect overruns. I use Embebbed Coder to generates the executable file (*.out). In simulink/configuration_parameters/code_generation/Code_target there is an option to create a "call custom fucntion" which is called when an averrun is detected. I would like to switch on a led when an overrun is detected. Could you give some tips to create that "custom function" (for exampple where I have to declarate the fucntion in matlqab/simulink or if there is any simulink/block to do it)?</p><p>Thanks in advance,</p><p>Manuel</p>manuelhttp://www.mathworks.com/matlabcentral/profile/authors/5739505-manueltag:www.mathworks.com,2005:Question/2667582016-02-05T08:38:56Z2016-02-05T18:32:30ZIncrease limit on Matrix size<p>Hi,</p><p>Presently matlab has put a limit of 10k on max array dimension. Matlab is not allowing me to use more than that. How can we increase it?</p><p>Thanks</p>Rehan Rehanhttp://www.mathworks.com/matlabcentral/profile/authors/7478642-rehan-rehantag:www.mathworks.com,2005:Question/2664622016-02-03T15:36:29Z2016-02-05T18:30:45ZHow to get imshow with linear interpolation?<p>A bitmap image shown with <tt>imshow</tt> or <tt>imagesc</tt> will be nearest-neighbour interpolated (if <tt>truesize</tt> isn't possible),
which for most purposes seems a bad choice. What I'd like, is to have a function that does exactly the same as these two, but with linear interpolation.</p><p>I know that there are ways around this with <tt>imresize</tt>, but most of the times it'll be a hassle (for me).</p><p>As an example: A guide GUI with multiple axes each with bitmap data. Now if the window is resized it'll result in strong artefacts (due to the NN downsampling).</p><p>If there's a simple way, ideally just another function wrapping <tt>imshow</tt>, I'd tremendously appreciate seeing that.</p>blankreshttp://www.mathworks.com/matlabcentral/profile/authors/5901326-blankrestag:www.mathworks.com,2005:Question/2668282016-02-05T18:19:06Z2016-02-05T18:29:09ZDouble command does not work when converting 1*1 sym variable to a numerical value. What will work?<p>I am having trouble converting my unknown variables, solved using the symbolic toolbox(a_1,a_2,a_3), into numerical values. the error i get is</p><pre class="language-matlab">Error using symengine (line 59)
DOUBLE cannot convert the input expression into a double array.
If the input expression contains a symbolic variable, use VPA.
Error in sym/double (line 583)
Xstr = mupadmex('symobj::double', S.s, 0);
</pre><p>Heres my code:</p><pre class="language-matlab">Th_final= sym('Th_start+a_1*T*f^5+a_2*T*f^4+a_3*T*f^3')
Vel_final=sym('0== 5*a_1*T*f^4+4*a_2*T*f^3+3*a_3*T*f^2')
Acc_final=sym('0==20*a_1*T*f^3+12*a_2*T*f^2+6*a_3*T*f')
answer=solve(Th_final,Vel_final,Acc_final,'a_1','a_2','a_3');
Th_final=double(answer.a_1)
Th_final1=double(answer.a_2)
Th_final3=double(answer.a_3)
</pre><p>This is probably a very simple question but what command can i use to return numerical values of a_1,a_2,a_3?</p><p>Thanks</p>braydon boydhttp://www.mathworks.com/matlabcentral/profile/authors/6834026-braydon-boydtag:www.mathworks.com,2005:Question/2668312016-02-05T18:29:07Z2016-02-05T18:36:38ZHow to fix an mzxmlread error?<p>I used the program msconvert from proteowizard to convert my Thermo .raw files to .mzXML files. When I use the mzxmlread command in MATLAB2015b(mzxmlread('data1.mzXML');) in matlab, I get this...</p><p>Starting to parse document...</p><p>Building mzXML substructure...</p><p>Building scan substructure...</p><p>Error using typecast</p><p>The first input must contain a multiple of 8 elements to convert from int8 (8 bits) to double (64 bits).</p><p>Error in mzxmlread>processPeaks (line 699)
mzpeaks = swapbytes(typecast(peaks,'double'));</p><p>Error in mzxmlread/parseScan (line 555)
out.(elementNameScan)(countScan+1).peaks.mz =
processPeaks(b64.decode(data),64);</p><p>Error in mzxmlread (line 420)
parseScan;</p>Shenaehttp://www.mathworks.com/matlabcentral/profile/authors/4407404-shenaetag:www.mathworks.com,2005:Question/2668292016-02-05T18:22:54Z2016-02-05T18:22:54ZDynamic Listboxes in GUI<p>Hello everyone! I am trying to populate a listbox in GUI with just excel files. I use the following code to get a structure of file names:</p><pre> list = dir('C:\Users\Dimitri\Desktop\Project\*.xlsx');
num_files_found = sum(~cellfun(@isempty,{list.name}));
for i= 1:num_files_found
a = list(i)
a = a.name
str{i} = a
end</pre><p>Now I'm trying to instert this string using:</p><pre> set(handles.listbox1,'String',str)</pre><p>Like some of the other solution online tell me to do, but nothing works, sometimes I get errors, and other times nothing happens.</p><p>Can someone please explain where exactly to put what in this code for this to work.</p><pre> function varargout = new_study_gui(varargin)
% NEW_STUDY_GUI MATLAB code for new_study_gui.fig
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @new_study_gui_OpeningFcn, ...
'gui_OutputFcn', @new_study_gui_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before new_study_gui is made visible.
function new_study_gui_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to new_study_gui (see VARARGIN)
% Choose default command line output for new_study_gui
handles.output = hObject;
list = dir('C:\Users\Dimitri\Desktop\Project\*.xlsx');
num_files_found = sum(~cellfun(@isempty,{list.name}));
for i= 1:num_files_found
a = list(i);
a = a.name;
str{i} = a;
end
set (handles.listbox1, 'String', str)
% set(handles.listbox1,'string',str)
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes new_study_gui wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = new_study_gui_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% --- Executes on button press in radiobutton1.
function radiobutton1_Callback(hObject, eventdata, handles)
% hObject handle to radiobutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of radiobutton1
% --- Executes on button press in radiobutton2.
function radiobutton2_Callback(hObject, eventdata, handles)
% hObject handle to radiobutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of radiobutton2
function edit1_Callback(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit1 as text
% str2double(get(hObject,'String')) returns contents of edit1 as a double
% --- Executes during object creation, after setting all properties.
function edit1_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on selection change in listbox1.
function listbox1_Callback(hObject, eventdata, handles)
% hObject handle to listbox1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns listbox1 contents as cell array
% contents{get(hObject,'Value')} returns selected item from listbox1
% --- Executes during object creation, after setting all properties.
function listbox1_CreateFcn(hObject, eventdata, handles)
% hObject handle to listbox1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: listbox controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- If Enable == 'on', executes on mouse press in 5 pixel border.
% --- Otherwise, executes on mouse press in 5 pixel border or over radiobutton1.
function radiobutton1_ButtonDownFcn(hObject, eventdata, handles)
% hObject handle to radiobutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
function edit2_Callback(hObject, eventdata, handles)
% hObject handle to edit2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit2 as text
% str2double(get(hObject,'String')) returns contents of edit2 as a double
% --- Executes during object creation, after setting all properties.
function edit2_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on selection change in listbox2.
function listbox2_Callback(hObject, eventdata, handles)
% hObject handle to listbox2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns listbox2 contents as cell array
% contents{get(hObject,'Value')} returns selected item from listbox2
% --- Executes during object creation, after setting all properties.
function listbox2_CreateFcn(hObject, eventdata, handles)
% hObject handle to listbox2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: listbox controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end</pre>Dimitri Dobroskokhttp://www.mathworks.com/matlabcentral/profile/authors/5874232-dimitri-dobroskoktag:www.mathworks.com,2005:Question/2667842016-02-05T12:11:59Z2016-02-05T18:19:24Z i want calculate number of sensor nodes between each sector area.<p>i want calculate number of sensor nodes between each sector area.</p><p>Sir, i am using linspace, and working on wireless sensor network, my code is</p><pre class="language-matlab">n=0;
for tet=linspace(0,2*pi,s+1) %s=number of sectors
for i= 1:1:n
n =n+1;
end
n
</pre>poonam tailorhttp://www.mathworks.com/matlabcentral/profile/authors/6013600-poonam-tailortag:www.mathworks.com,2005:Question/2668272016-02-05T17:54:54Z2016-02-05T18:01:45Zvolumetric efficiency of a hydraulic pump<p>In steady state the inflow and outflow from a pump are the same even though the volumetric and overall efficiencies are less than 1.</p><p>In the transient part of the calculation decreasing the efficiency increases the time to steady state. Once steady state has been reached the efficiency doesn't have any effect.</p><p>Is this a bug, because the predicted phenomenon is not correct.</p><p>Any assistance is appreciated</p><p>Thanks in advance</p><p>allan</p>allan thomsonhttp://www.mathworks.com/matlabcentral/profile/authors/7547024-allan-thomsontag:www.mathworks.com,2005:Question/2667852016-02-05T12:22:34Z2016-02-05T18:01:43ZCSV Date time error<p>Hello all,</p><p>I hope someone can help point me in the right direction. I may have been staring too much at how to achieve this but here goes:</p><p>Currently testing out how to import CSV file into matlab whiles using the date time information from the file onto a graph.</p><p>The file imports ok and shows the date time as e.g</p><pre class="language-matlab">if true
% 2013-12-16 11:21:51.110
2013-12-17 13:53:53.710
2013-12-17 10:04:58.710
</pre><pre class="language-matlab">end
</pre><p>This is displayed in a 65x1 cell called date_time and the other column is called amplitude which shows numerical data.</p><p>Im trying to plot a scatter graph which uses the date_time against the amplitude but keep on getting an error (Error using plot Invalid first data argument).</p><p>I have tried to convert the csv file into excel, import into matlab in where the date_time is shown in numerical values. This does work although the date time information is not displayed on the graph.</p><p>The first option would be easier to use as this will stop having to import via excel first then into matlab.
Would the date_time need to be converted into numerical points first, if so im not sure how this is done.</p><p>Would appreciate some guidence on this. Sure its pretty easy but Matlab is slowly defeating me.</p><p>If you need anymore information on this happy to send some over.</p><p>Many thanks</p>Dan Howardhttp://www.mathworks.com/matlabcentral/profile/authors/7618196-dan-howardtag:www.mathworks.com,2005:Question/2667712016-02-05T10:05:20Z2016-02-05T17:58:46ZError from comand line<p>Hi, when Iam using script like:</p><pre class="language-matlab">h = find_system(mdl,'FindAll','on','Name','Positive Arm A');
no_cells = 10;
set(h,'no_cells',num2str(no_cells))
</pre><p>I got error message:</p><pre class="language-matlab">Error using using_IGBT (line 11)
SubSystem block does not have a parameter named 'No_cells'
</pre><p>whats wrong with this script ?
the parametr no_cells defined above...</p><p>Thanks,
Henry</p>Henry Buckhttp://www.mathworks.com/matlabcentral/profile/authors/6798441-henry-bucktag:www.mathworks.com,2005:Question/2667012016-02-04T23:25:54Z2016-02-05T17:53:38ZDownload a lot of images from url<p>If I have a txt file, which contains the url that downloads images, how do we write the script to do that?</p><p>e.g. txt file information:</p><p><a href = "http://forensics.inf.tu-dresden.de/ddimgdb/images/gallery/Canon_Ixus55_0_3194.JPG">http://forensics.inf.tu-dresden.de/ddimgdb/images/gallery/Canon_Ixus55_0_3194.JPG</a></p><p>..
..
...</p>matlabgeekhttp://www.mathworks.com/matlabcentral/profile/authors/7421145-matlabgeektag:www.mathworks.com,2005:Question/2596322015-12-10T05:00:00Z2016-02-05T17:42:11ZHow can I get MATLAB installation files for use on an offline machine?<p>I need to install MATLAB on an offline machine and I understand that the installer downloaded from the MathWorks website does not contain the necessary files.</p><p>How can I get these files?</p>MathWorks Support Teamhttp://www.mathworks.com/matlabcentral/profile/authors/4622813-mathworks-support-teamtag:www.mathworks.com,2005:Question/2668092016-02-05T15:22:47Z2016-02-05T17:42:00ZHelp To Crop Dilated Images<p>hi, how can I crop or get the ROI of the white area (the rectangle) of the image? I used imdilate then imfill.</p><p>here's the code:</p><pre class="language-matlab">%Dilation
Id = imdilate(gg1, strel('diamond', 1));
figure, imshow(Id); title('Dilation');
</pre><pre class="language-matlab">%Fill
If = imfill(Id, 'holes');
figure, imshow(If); title('Fill');
</pre><img src = "/matlabcentral/answers/uploaded_files/44817/Capture.PNG">Tip Rielhttp://www.mathworks.com/matlabcentral/profile/authors/7625162-tip-rieltag:www.mathworks.com,2005:Question/2668242016-02-05T17:33:48Z2016-02-05T17:43:19ZLarge MAT file corrupted by multiple loading<p>I have recently run into a recurring problem with previously sound MAT files becoming inexplicably corrupted. This has happened with multiple distinct MAT files and with no obvious pattern. The latest example is a file that is supposed to load two multiple-element structures with fields that contain only numeric arrays:</p><pre> whos
glAll 1x412 21707848 struct
dissAll 1x412 5207459268 struct</pre><p>I repeatedly loaded and worked with the data in the file for about 4 days. On the fifth day, running the same code (load myFile.mat) produces an "Unable to read file" error, without further explanation. The MAT file was not modified in my scripts, and nothing in the directory structure has changed (ie. the file is present in the working directory). In this example the MAT file is quite large (5 GB) but I've had the same problem with smaller files (~500 MB). This particular file was created using</p><pre class="language-matlab">save -v7.3 GliderDissAll.mat glAll dissAll
</pre><p>but I've had the same issue with -v7 files. I am running OS X El Capitan 10.11.2 and R2015b. Why do my previously-uncorrupted files suddenly become corrupted, though they were never explicitly modified?</p><p>Update: I should mention, the working directory is on an external server not on my local machine. I connect to the server through a local ethernet over the thunderbolt port.</p>Benjaminhttp://www.mathworks.com/matlabcentral/profile/authors/7625622-benjamintag:www.mathworks.com,2005:Question/2668232016-02-05T05:00:00Z2016-02-05T17:27:01ZI get a error "An error occurred during a write access to Job-1.mdl file" only when using Abaqus while MATLAB is running.<p>I am using Abaqus while MATLAB in running. Then Abaqus is executing on the same folder as the current folder of MATLAB, I get an error</p><pre class="error"> An error occurred during a write access to Job-1.mdl file.</pre><p>This happens only when MATLAB is running in the same folder as Abaqus. Why do I get this error? Is there a workaround?</p>MathWorks Support Teamhttp://www.mathworks.com/matlabcentral/profile/authors/4622813-mathworks-support-teamtag:www.mathworks.com,2005:Question/2668222016-02-05T17:09:17Z2016-02-05T17:09:17ZWhat is the frequency of Matlab to sample the coordinate data of mouse pointer, and Can this frequency be customized?<p>I have to sample the coordinate data of mouse pointer in real time. I didn't find any information on the default frequency of Matlab's sampling frequency. Could anyone tell me how to check this frequency, and could this frequency be changed?
Thanks!</p>Yanlong Songhttp://www.mathworks.com/matlabcentral/profile/authors/4923194-yanlong-song