http://nl.mathworks.com/matlabcentral/answers/questions.atomMATLAB Answers — New Questions2015-04-28T10:29:57Ztag:nl.mathworks.com,2005:Question/2139442015-04-28T10:11:00Z2015-04-28T10:29:57Zlogical indexing between two varaibles<p>I have these variables</p><pre> i = i=3.02:0.00008:3.098;</pre><pre> j= 3.020005:0.00008:3.098005;</pre><p>and a numerical array of 1000000x10. I want to determine in specific columns where the values of are between those of i and j, so in the first case the value would be between 3.02 and 3.020005. I have tried some logical indexing where I used</p><pre> index = (merged(merged(:,3) > i & merged(:,3) < j)); </pre><p>This however only seems to work if my numerical array is of the same dimensions as i and j which in this case would be 976x10. Any ideas how else to go about this to use logical indexing but with a numerical array of a larger size?</p>Rami Ahmadhttp://nl.mathworks.com/matlabcentral/profile/authors/6465976-rami-ahmadtag:nl.mathworks.com,2005:Question/2139262015-04-28T07:24:07Z2015-04-28T10:28:32Zhow to pass array using get, set from one gui to other?<p>hii
I have 2 gui.In main gui I have passed array of images like dis-</p><pre> > for i=1:120
> > imgs{i} = imread( sprintf('%d.jpg',idx(i) ));
> > set(0,'userdata',imgs{i})
> end</pre><p>In sub gui I hav used this code to get images</p><p>>for i=21:60</p><p>> > imgs{i}= get(0,'userdata');</p><p>> end</p><p>> axes(handles.axes28)</p><p>> imshow(imgs[21])</p><p>> axes(handles.axes29)</p><p>> imshow(imgs[22])
.
.
.
everytime I am getting 120 th image plotted in all 60 output axis...
Whats wrong here pls clarify.</p>preetihttp://nl.mathworks.com/matlabcentral/profile/authors/5593219-preetitag:nl.mathworks.com,2005:Question/2139312015-04-28T07:54:51Z2015-04-28T10:28:04ZError when evaluating clusters of a dataset<p>I'm trying to evaluate the number of a dataset, data is described bellow and clust are the results of a clustering algorithm (vector of classes):</p><pre class="language-matlab">eva=evalclusters(data,clust,'CalinskiHarabasz');
</pre><p>Depending on the data input I'm receiving almost all time the error:</p><pre class="language-matlab">Error using clustering.evaluation.ClusterCriterion (line 447)
The number of clusters to be evaluated must be different for different clustering solutions.
</pre><p>How can I solve the error? The dataset input looks like:</p><pre class="language-matlab">123.52 0 0 0 0 276.4 0 0 101065 -71.25 1430141730 1239449.142 0 0 1
142.55 0 0 0 0 197.2 0 0 173400 -73.75 1430141730 19179182.65 0 0 2
154.17 0 0 0 0 452.65 0 0 109525 -4.75 1430141730 40463515.23 0 0 3
162.29 0 0 0 0 499.45 0 0 131570 -9.5 1430141730 46961147.29 0 0 3
</pre><p>Columns are properties and rows are observations.</p><p>Thank you.</p>Albertohttp://nl.mathworks.com/matlabcentral/profile/authors/6222328-albertotag:nl.mathworks.com,2005:Question/2137752015-04-27T11:42:25Z2015-04-28T10:26:03ZCreate columns with no zero sequentially elements of a vector <p>I have a vector A=[4,2
3
2
2
0
0
1
2
2
0
0
1
2
3] and I am trying to create columns in new matrix with no zero sequentially elements, with a loop without success.Β1=[4,2
3
2
2] B2=[1
2
2] etc</p><p>I want to have a column with elements of A and when I find zero to create another column. Do you believe that it is feasible?</p>nmartzhttp://nl.mathworks.com/matlabcentral/profile/authors/6305070-nmartztag:nl.mathworks.com,2005:Question/2139342015-04-28T08:20:56Z2015-04-28T10:19:54ZHow to use guidata ?<p>Hello,
I have 2 push buttons. One to take input from a file. And other is a button named "calculate".</p><p>Now under 2n'd push button I am taking 4 inputs from user as numbers. An now by calculating data from file uploaded by user and values given by user the "calculate" will trigger the calculations.</p><p>Now what error I am getting is, the values from 1st pushbutton are not getting saved under workspace to use by 2nd button. I tried guidata but could not make it work.</p><p>Can any one give me the solution to have guidata ?</p><p>Here is my code for 1st pushbutton:</p><pre class="language-matlab">[filename,pathname] = uigetfile('*.txt')
loaddata = fullfile(pathname,filename)
xy = load(loaddata);
a = xy(:,1)
b = xy(:,2)
c = xy(:,3)
d = xy(:,4)
handles.input1 = a;
handles.input2 = b;
handles.input3 = c;
handles.input4 = d;
guidata(hObject,handles)
</pre>adi kulhttp://nl.mathworks.com/matlabcentral/profile/authors/6315989-adi-kultag:nl.mathworks.com,2005:Question/2139452015-04-28T10:18:07Z2015-04-28T10:18:07ZReturn value of Modified cyclomatic complexity<p>Hello,</p><p>Is there any way that Polyspace CodeProver could return also the "modified cyclomatic complexity" value, besides the existing Vg "cyclomatic complexity"?</p><p>Modified cyclomatic complexity is a variant of Cyclomatic Complexity in which switch statements are considered to have the same effect on complexity as if statements, regardless of the number of switch cases. (more here <a href = "http://www.grammatech.com/codesonar/workflow-features/cyclomatic-complexity">http://www.grammatech.com/codesonar/workflow-features/cyclomatic-complexity</a>)</p><p>Thank you,
Daniel</p>Daniel Popuhttp://nl.mathworks.com/matlabcentral/profile/authors/5250757-daniel-poputag:nl.mathworks.com,2005:Question/2139292015-04-28T07:53:00Z2015-04-28T10:07:51ZError message while using Fullfile to write .m file in a specific folder<p>Hello,</p><p>I have some troubles using fullfile function in order to store outputs in a specific folder.</p><p>Error using fullfile (line 61)
An unknown error occurred in FULLFILE while constructing the file specification.</p><p>Error in Test_Export (line 14)
f=fullfile(myFolder,fileID);</p><p>Caused by:
Error using horzcat
The following error occurred converting from logical to char:
Error using char
Conversion to char from logical is not possible.</p><p>The code i'm using is attached. Any ideas please to fix it?</p><p>Thank you in advance for your help</p><p>Fatzo</p>Fatzohttp://nl.mathworks.com/matlabcentral/profile/authors/4221992-fatzotag:nl.mathworks.com,2005:Question/2137542015-04-27T09:54:26Z2015-04-28T10:07:42ZToc returns loop time instead of total script time<p>Hi</p><p>I have a script with a large loop nested inside another loop, and i would like to time the progress of the loop, using the tic/toc commands.</p><p>The code is like this:</p><p><b>tic</b></p><p>--some code and small loops--</p><p>for i=1:lengthi</p><p>for j=1:lengthj</p><p>clc</p><p>disp(['Iteration: ' num2str((i-1)*lengthj+j) ' of ' num2str(lengthi*lengthj)]);</p><p><b>toc</b></p><p>--some code--</p><p>end</p><p>end</p><p><b>toc</b></p><p>however, when I run the code, toc seems to display the time since last toc, instead of the time since tic.
The problem is not exclusive to this piece of code, I have noticed it before with other scripts.</p><p>Any thoughts or experience with this?</p><p>-Nicolas</p>Nicolas Schnedler-Meyerhttp://nl.mathworks.com/matlabcentral/profile/authors/5854030-nicolas-schnedler-meyertag:nl.mathworks.com,2005:Question/2139432015-04-28T10:05:53Z2015-04-28T10:05:53ZWhy does convolution of two functions depend on increment size<p>I am trying to convolve a response function for some equipment, with a signal, to give a predicted output but for some reason the output I am getting seems to heavily depend on the increment size I use for the response function.</p><p>My response function is:</p><p>sigRes = (2*pi/(tau))*exp(-(T*2*pi)/(tau));</p><p>where tau is a time-constant for the equipment. I want to convolve this with some data, which is either 1 or 0 at each time-step. In theory, the convolution should be able to reach a maximum of 1 if the data is 1 for a great enough length of time, around the value of the time constant.</p><p>However what is happening when I do output=conv(data,sigRes) is, the output will give 1 if my increments for T in sigRes are 1, but if it increments in 10 say, the output will reach a maximum of 0.1 instead. I do not see why the sampling of my time, T, should affect the output. Any help would be greatly appreciated.</p>David Perryhttp://nl.mathworks.com/matlabcentral/profile/authors/3859870-david-perrytag:nl.mathworks.com,2005:Question/2139352015-04-28T08:32:51Z2015-04-28T10:03:05Zhow to solve car number plate extraction using matlab<p>hello every one</p><p>i want code about car number extraction to solve my topic</p><p>please please</p>ahmed jasimhttp://nl.mathworks.com/matlabcentral/profile/authors/6465530-ahmed-jasimtag:nl.mathworks.com,2005:Question/2138262015-04-27T17:03:17Z2015-04-28T10:01:53ZRemove noises from image<p>I should remove noises from attached image. I saw gaussian noise and I tried to remove it. However there are other noises at low frequency (in my opinion) that I should remove to make the image more visible. Can I apply hight pass filter? Are there other kind of noises in your opinion?
this is the code that I wrote:</p><pre class="language-matlab">im=imread('lenaNoise.jpg');
%remove gaussian noise
h=fspecial('gaussian',13,.9);
s=imfilter(im,h,'conv');
figure(5)
subplot(1,2,1),imshow(im,[])
subplot(1,2,2),imshow(s,[])
</pre><p>then I tried to apply hight pass filter but I got wrong</p><pre class="language-matlab">%hight pass filter
sd=im2double(s);
[f1,f2] = freqspace(31,'meshgrid');
Hd = ones(31);
r = sqrt(f1.^2 + f2.^2);
Hd(r<0.6) = 0;
im_filtered=imfilter(sd,Hd,'conv');
%im_filtered=uint8(im_filtered);
figure(6)
subplot(1,3,1),imshow(im,[])
subplot(1,3,2),imshow(s,[])
subplot(1,3,3),imshow(im_filtered,[])
</pre><p>Can someone help me to remove all noises from this image or suggest me how to do?</p>Silvia Carusohttp://nl.mathworks.com/matlabcentral/profile/authors/6379480-silvia-carusotag:nl.mathworks.com,2005:Question/2139412015-04-28T09:00:56Z2015-04-28T09:53:23ZHow can I delete the extra matrices which contain NaN and 0 values?<p>Dear All,
I have a 30 year dataset (1961.02.1-1990.11.30) in cell array which contains 358 matrices where the data are stored longitude x latitude x days. I had to convert this cell to 4D matrix for calculation. I carried out this by the following way:</p><pre class="language-matlab">maxSize = max(cellfun(@(x) size(x,3),out_m));
f = @(x) cat(3, x, nan(size(x,1),size(x,2),maxSize-size(x,3)));
out_m2 = cellfun(f,out_m,'UniformOutput',false);
PL = bsxfun(@times, out_m2, l);
PL2=reshape(num2cell(PL,[1 2 3]),[],1);
P_scen=cat(3,PL2{:});
</pre><p>Thust every month has 31 days. I would like to write the P_scen into netcdf file.
The values are stored longitude x latitude x time. Its time length is 11098 due to the conversation. The time has to be determined in netcdf file by:</p><pre class="language-matlab">T(:,1)=[datenum(1961,2,1,0,0,0):datenum(1990,11,30)];
time(:,1)=T(:,1)-datenum(1950,1,1);
</pre><p>So this time length is 10895. How can I delete the extra days which contain NaN and 0 values?
Thank you for your help in advance!</p>Szabó-Takács Beátahttp://nl.mathworks.com/matlabcentral/profile/authors/6427862-szabo-takacs-beatatag:nl.mathworks.com,2005:Question/2139052015-04-28T05:41:37Z2015-04-28T09:44:26ZMake unequally spaced data, equally spaced<p>Hello all,</p><p>I have the hourly temperature history for a long period of time (100k datapoints) for several locations. For easier data manipulation I would like 24 measurements for each day. However the data I have, has sometimes either 2-4 measurements within the same hour or inversely there are some hours without any measurement.</p><p>The time spamps are of the format 200001010000 (YEARMODAHRMN). I would like to ask you if you can think or have any script that could do the interpolation between adjacent data so that finally I end up with data points that are equally spaced.</p><p>Thank you in advance.</p>Konstantinos Belivanishttp://nl.mathworks.com/matlabcentral/profile/authors/4273067-konstantinos-belivanistag:nl.mathworks.com,2005:Question/2138902015-04-28T03:46:57Z2015-04-28T09:41:17ZCan i open a 64 bit file on my 32 bit computer?<p>i have been given a 64 bit file which i cannot open on my computer because my computer is 32 bit Windows 7 Professional. The file is 2012b version 64. i cannot download the same software because of 32 bit issue. I need to stay in 2012b version.</p><p>Is there a way that i can open 2012b 64 bit file in 2012b 32 bit system?</p><p>Many thanks. i would appreciate a quick reply if possible as i need to finalise assignment within next 12 hours</p>Peter Adamshttp://nl.mathworks.com/matlabcentral/profile/authors/6465017-peter-adamstag:nl.mathworks.com,2005:Question/2139422015-04-28T09:39:55Z2015-04-28T09:39:55ZHow do I access model workspace variables in simulink/simevents?<p>I have varying transport times in a discrete events system. I have created a matrix of the times in the model workspace but I cannot find how i access that variable from within the model.</p><p>I currently have a Attribute function where I try to access the model workspace. How do I do?</p>Matshttp://nl.mathworks.com/matlabcentral/profile/authors/3009159-matstag:nl.mathworks.com,2005:Question/2139102015-04-28T06:03:12Z2015-04-28T09:31:34ZHow can I get updated value of UI toggle button, within it's callback function?<p>I want to use a toggle button as an on of switch. So when the button is pressed, the work is done untill the button is depressed. But in my code, the button depress doesn't work because 1st callback (when button pressed) is still being executed, and without the second callback, the Value isn't updated.</p><p>function togglebutton1_Callback(hObject, eventdata, handles)
% hObject handle to togglebutton1 (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 togglebutton1</p><p>while (get(hObject, 'Value') == get(hObject,'Max'))</p><pre> _..do the work.._</pre><p>end</p>Kartik Sharmahttp://nl.mathworks.com/matlabcentral/profile/authors/6212637-kartik-sharmatag:nl.mathworks.com,2005:Question/2139362015-04-28T08:41:17Z2015-04-28T09:20:42Zoperations on nested cell array<p>Hi</p><p>I have a cell array n "5290*1" which further contains cell array such that n{1,1} is a cell size "7*1" and
n{1,1}{1,1} is 3*204 elements. How do i access the inner cell array elements if i need to perform operation on them e.g. min? I do not want to run for loop.</p><p>Many thanks for your help.</p>Adityahttp://nl.mathworks.com/matlabcentral/profile/authors/4742678-adityatag:nl.mathworks.com,2005:Question/2139372015-04-28T08:48:26Z2015-04-28T09:13:00Zmatlab gui code for pushbutton1 want continue the process to pushbutton2<p>pushbutton1 to load the image from file</p><pre class="language-matlab">if true
% % --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
path = 'C:\Users\yazid-daa\Desktop\fyp\matlab\';
filter = '*.jpg';
selectedFile = uigetfile(fullfile(path , filter))
b =['C:\Users\yazid-daa\Desktop\fyp\matlab\',selectedFile]
a= imread(b);
figure,imshow(a),title('Face Recognition')
</pre><pre class="language-matlab">end
</pre><p>where pushbutton2 to process the image</p><pre class="language-matlab">if true
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
B=rgb2gray(a);
figure,imshow(B),title('GrayImage');
C=im2bw(B);
figure,imshow(C),title('im2bw');
D=medfilt2(B,[5 5]);
E=D(:,:,1);
threshold=160/255;
bw=im2bw(E,threshold);
figure,imshow(bw);
bw=bwareaopen(bw,10000);
se=strel('disk',20);
bw=imclose(bw,se);
bw=~bw;
bw=imfill(bw,'holes');
figure,imshow(bw);
end
</pre><p>how can the image choose from the file can be callback to pushbutton2 without load back from the file??</p>yazid daahttp://nl.mathworks.com/matlabcentral/profile/authors/6269350-yazid-daatag:nl.mathworks.com,2005:Question/2139402015-04-28T08:59:56Z2015-04-28T08:59:56Zcan anyone help, how to extract bounding box values from blob analysis in GMM method. thank you<p>i'm using GMM method to segment the moving objects and to detect object by using tld algorithm.</p><p>everything is okay but i need bounding box values from blob analysis..</p><p>finally i got values but when it is given as input to the tld algorithm , it shows error like bounding box is too small of invalid.</p><p>the problem is in the video stream i got 9 objects detects using GMM, when i try to retrieve bbox values it will retrieve 9*4=36 values, so i need to retrieve any ones's object bbox values, so please any one help with that... thank you</p>sunil pariwanhttp://nl.mathworks.com/matlabcentral/profile/authors/4561542-sunil-pariwantag:nl.mathworks.com,2005:Question/2137372015-04-27T08:30:47Z2015-04-28T08:54:32ZHelp with plot legend<p>I am trying to plot several groups (25 in my example) of data on one plot, with a legend representing each. Here is my code:</p><pre> aa = 25;
c = hsv(n);
n = 25</pre><pre> figure; hold on; axis tight; grid on; box on;</pre><pre> for k = 1:n;</pre><pre> xy = c(k,:); % assign a different color to each group</pre><pre class="language-matlab">a = outputs2{1,k} % my data is held in cells in a 1 x 25 cell array
</pre><pre class="language-matlab">if sum(a) ~= 0; % some groups of data are empty (this data was generated from the nctool
</pre><pre> h(k) = scatter(a(:,3), a(:,1), aa, xy, 'filled') % seems to work....</pre><pre> name{k} = ['group ' num2str(k)]; % attempting to make a string array for the legend</pre><pre class="language-matlab">end
</pre><pre> end
legend(h, name);</pre><p>But i get this error:</p><pre> Error using legend (line 120)
Invalid argument. Type 'help legend' for more information.</pre><pre> Error in PlotOutputs2 (line 19)
legend(h, name);</pre><pre> Error in run (line 96)
evalin('caller', [script ';']);</pre><p>The plot works, just not the legend. I've tried a hundred different variations and this is the closest i can get.</p><p>Also, and this is a different problem, but i spent some time trying to install the legappend tool this morning with no luck. That was also error prone. With that, i ran the example that comes with it and just got errors. I'm not sure what the mistake I'm making with that is.</p><p>Also today I reinstalled MATLAB just in case I had damaged the legend tool somehow.</p><p>Any help is greatly appreciated!!!!</p>Josh Whitehttp://nl.mathworks.com/matlabcentral/profile/authors/6436871-josh-whitetag:nl.mathworks.com,2005:Question/2138692015-04-27T23:06:33Z2015-04-28T08:52:34ZSetting callbacks to respond to incoming messages on a LightStreamer channel.<p>I'm finding this a difficult question to phrase correctly because I don't quite know which technologies are relevant.</p><p>I want to read an open channel from <a href = "http://www.lightstreamer.com/">LightStreamer</a>, in particular the LightStreamer service from <a href = "http://labs.ig.com/">IG</a>.</p><p>LS operates in two modes: streaming and polling (streaming being preferred). I have quite successfully written a lot of code to handle a polling connection (setting <tt>LS_polling=true</tt> on <tt>/lightstreamer/create_session.txt</tt> ; <tt>false</tt> is the default) but handling a stream connection would be much more efficient and simplify the process quite considerably.</p><p>I've been using Jim Hokanson's excellent <a href = "http://www.mathworks.com/matlabcentral/fileexchange/35693-urlread2">URLREAD2</a> function for polling but this appears to hang if I try it in a streaming mode, on line <tt>263</tt> of the following, if that's helpful to anyone.</p><pre class="language-matlab">260 byteArrayOutputStream = java.io.ByteArrayOutputStream;
261 % This StreamCopier is unsupported and may change at any time. OH GREAT :/
262 isc = InterruptibleStreamCopier.getInterruptibleStreamCopier;
263 isc.copyStream(inputStream,byteArrayOutputStream);
</pre><p>I'm wondering if some modification to URLREAD2 might be possible that would open the connection and allow the setting of callbacks to handle incoming messages?</p>Neil Caithnesshttp://nl.mathworks.com/matlabcentral/profile/authors/13235-neil-caithnesstag:nl.mathworks.com,2005:Question/2139392015-04-28T08:51:54Z2015-04-28T08:51:54ZNN NARX Basic question<p>Hi</p><p>NARX question</p><p>If I have trained narx network and after making it close looped I predict the outcomes using new inputs, does it matter what the sequence of input data is to the network? Will results be same or different?.</p><p>For example, if [1 2 3 4] has the output [10 11 12 13] will [3 4 1 2] have the output of [12 13 10 11] or will it be different due to a different sequence?</p><p>A bit of reasoning will be highly appreciated.</p><p>Thanks</p>Nauman Shahhttp://nl.mathworks.com/matlabcentral/profile/authors/6372032-nauman-shahtag:nl.mathworks.com,2005:Question/2139162015-04-28T06:45:30Z2015-04-28T08:51:47ZHow to create function with net<p>Undefined function 'net' for input arguments of type 'double'.</p><p>Error in test (line 2)
outputs = net(inputs);</p>matlabuserhttp://nl.mathworks.com/matlabcentral/profile/authors/6465400-matlabusertag:nl.mathworks.com,2005:Question/2126702015-04-21T15:19:55Z2015-04-28T08:50:43ZNARX Neural Network - Adding a constraint <p>Hi</p><p>I'm working with NARX NN and predicting the weighted average ,high and low prices of electricity market based on forecast.</p><p>The correlation that I'm with Weighted average is good, however for low and high it isn't which is understandable as it's a spot market price and very speculative.</p><p>However, the problem I'm facing is that even in training and testing, the high price does get lower than the weighted average (many times) and even lower than low price a few times, which is practically impossible.</p><p>My question is, is there a way to add a numeric constraint of sorts that, for instance, if I use the predicted weighted average as an input for the high price (or low for that matter) it should remain above the weighted average for high or below the weighted average for low.</p><p>Any thoughts?</p>Nauman Shahhttp://nl.mathworks.com/matlabcentral/profile/authors/6372032-nauman-shahtag:nl.mathworks.com,2005:Question/2139382015-04-28T08:48:37Z2015-04-28T08:48:37ZHow can I find J-point in ECG<p>I detected P-QRS-T points in an ECG signal(MIT-BIH) and now I need to find the j-point in it. Also I can't find an annotated database for the J-point. Would you please advise me how to solve these problems.</p>shahram taherihttp://nl.mathworks.com/matlabcentral/profile/authors/6465712-shahram-taheritag:nl.mathworks.com,2005:Question/2139182015-04-28T06:47:30Z2015-04-28T08:48:31ZHow to Generate Compressor Map ?<p>Hi Everyone. I want to create Compressor Map . Could you advice me a literature or something that i learn how to create it. Compressor Map is like that.http://www.bing.com/images/search?q=compressor+map&view=detailv2&&&id=D61567EA61B4BF1A32914B7A2F3D3FF257056D97&selectedIndex=0&ccid=QGX3rBFL&simid=608043743320213901&thid=JN.Cklz7CSwlqnK5IUxzxcj8g&ajaxhist=0</p><p>. I have already drawn surge and choke lines .My Problem is: i do not know how i can draw Efficiency line which were as blue drawn??</p>cemsi888http://nl.mathworks.com/matlabcentral/profile/authors/6090806-cemsi888tag:nl.mathworks.com,2005:Question/2133762015-04-24T11:47:52Z2015-04-28T08:45:11ZHow do you fit a curve through 3D points, using splines, constrained within a volume.<p>Suppose I have an array of points in 3space,</p><pre class="language-matlab">[r1; r2; ... ; rn]
</pre><p>where</p><pre class="language-matlab">ri = [xi yi zi]
</pre><p>are it's coordinates. I want to fit a curve (a spline) in 3 dimensions between these points. However, I want the interpolated curve between points ri and rj to be constrained within a certain volume. How could I go about doing this?</p><p>EDIT: To elaborate, each pair of points exist on distinct faces of a shared tetrahedral. The interpolated curve between said points has to stay within this tetrahedral.</p>Laurence hutton-smithhttp://nl.mathworks.com/matlabcentral/profile/authors/2590267-laurence-hutton-smithtag:nl.mathworks.com,2005:Question/2134912015-04-25T05:21:09Z2015-04-28T08:39:03Zneed help in plotting mel frequency cepstral coefficients.<p>audio signal is inputted in .wav format and its mel frequency cepstral coefficients are extracted(MFCCs). these are stored in variable 'MFCCs'. size of matrix is <a href = "13x3498">double</a>. similarly i have another audio file and its coefficients are extracted and stored. i want to plot these two sets in cluster representation for showing that its different.since one audio file is normal baby cry signal and another is with some ailment.how to do this?</p>pranjalhttp://nl.mathworks.com/matlabcentral/profile/authors/6012750-pranjaltag:nl.mathworks.com,2005:Question/2137382015-04-27T08:32:55Z2015-04-28T08:35:32ZStart plot errorbar() at 0 ?<p>Hello,</p><p>In my matlab script, i use errorbar() to plot my data, but i wish it could start from 0 (for the y-axis).</p><p>Do you have an idea ?</p><p>Thanks !</p><p>Here is my sample :</p><p>>> x</p><p>moyenne(2:2,1:end)</p><p>ste(1:1,1:end)</p><p>x =</p><pre> 1 2</pre><p>ans =</p><pre> 64.7573 36.0701</pre><p>ans =</p><pre> 4.0268 4.6105</pre><p>>> errorbar(x,moyenne(2:2,1:end),ste(1:1,1:end));</p>Remi Chaussenothttp://nl.mathworks.com/matlabcentral/profile/authors/6219039-remi-chaussenottag:nl.mathworks.com,2005:Question/2139282015-04-28T07:48:19Z2015-04-28T08:24:18ZSplit uint8 vector if there is a Space (' ') (32)<p>I have for example a vector:</p><p>72 101 108 108 111 32 73 32 97 109 32 51 48 32 121 101 97 114 115 32 111 108 100 46</p><p>which means,</p><p>"Hello I am 30 years old.".</p><p>Now I want to split the vector after each space (' ') in a form like this:</p><p>72 101 108 108 111</p><p>73 32 97 109</p><p>51 48 32 121 101 97 114 115</p><p>111 108 100 46</p><p>and write this into an array or a new vetor to see if it is equal with, for example (72 101 108 108 111).</p>Dennis Sattelmaierhttp://nl.mathworks.com/matlabcentral/profile/authors/6413158-dennis-sattelmaiertag:nl.mathworks.com,2005:Question/2137332015-04-27T08:00:39Z2015-04-28T08:37:51ZDifference in output of find when using gpuArray<p>Hello,</p><p>I have this piece of code:</p><pre class="language-matlab">a = zeros(12,12,12);
for i=1:12, for j=1:12, for k=1:12
a(i,j,k)=((i-5)^2+(j-6)^2+(k-7)^2)<6;
end, end, end
b = find(a);
</pre><p>Now I've done the same thing using gpuArray.zeros instead of zeros, and I find that the output of the find function is different. b is of size 57x1. The output of the gpuArray version (call it b1) is of size 134x1. Also, the first 57 entries in b and b1 are the same. After that, there are a bunch of zeros and some other numbers. Any idea why the find function seems to be misbehaving for gpuArray?</p><p>Thanks in advance,
Ranjan</p><p>EDIT:
Here's some version info just in case it helps
CUDA VERSION: 6.5</p><p>the command nvidia-smi returns this:</p><pre class="language-matlab">+------------------------------------------------------+
| NVIDIA-SMI 346.47 Driver Version: 346.47 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 Tesla C2050 Off | 0000:05:00.0 Off | 0 |
| 52% 87C P0 N/A / N/A | 79MiB / 2687MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
</pre><pre class="language-matlab">+-----------------------------------------------------------------------------+
</pre><pre class="language-matlab">| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 29631 C /usr/local/MATLAB/R2014b/bin/glnxa64/MATLAB 71MiB |
+-----------------------------------------------------------------------------+
</pre>Ranjan Anantharamanhttp://nl.mathworks.com/matlabcentral/profile/authors/6461487-ranjan-anantharamantag:nl.mathworks.com,2005:Question/2137322015-04-27T07:53:10Z2015-04-28T08:14:33ZMinimized function ARE does not plot properly against w,I mentioned how the Function ARE plot should seem ? I am using simulannealbnd function to minimize this fun ARE by passing its handle to simulannealbnd. Below is the code I got plot by Torsten <p>============================
Main File
============================</p><p>a0 = [.0001 .0001 .0001 .0001 .0001 ];</p><p>w = linspace(0,pi,1000);</p><p>for i=1:length(w)</p><p>w_scal=w(i);</p><p>f =@(a)abc(a,w_scal);</p><p>[a_vec fval] = simulannealbnd(f,a0);</p><p>a_mat(:,i)=a_vec(:);</p><p>end</p><p>============================
Function File
============================</p><p>function ARE = abc(a,w)</p><p>ARE = ((1/(j*w)) - ((a(1)*exp(2*j*w) + a(2)*exp(j*w) + a(3)) / (exp(2*j*w)+a(4)*exp(j*w) +
a(5)))/(1/(j*w)));</p><p>======================
Practical Plot
======================</p><img src = "/matlabcentral/answers/uploaded_files/29871/untitled.jpg"><p>===============================
Required Plot which should plot
===============================</p><img src = "/matlabcentral/answers/uploaded_files/29872/2%20best%20integrator.jpg"><p>Conclusively, coefficients a(1)....a(5) should be correct calculated. But I my case, getting wrong values.</p><p>Thanks,
Nitin</p>Nitin Rawalhttp://nl.mathworks.com/matlabcentral/profile/authors/5368816-nitin-rawaltag:nl.mathworks.com,2005:Question/2139002015-04-28T05:00:09Z2015-04-28T08:03:39ZI need to solve an equation set :( <p>Hi, I need to solve an equation, but I don't know how. here's the equation set.</p><p>P*S=A*P+B*G+E</p><p>0= C*P+D*G+De</p><p>P and G are the unknown matrices. S is 4*4, A is 5*5, B is 5*3, E is 5*4; and C is 3*5, D is 3*3 and De is 3*4.</p>Hassan Dehghanihttp://nl.mathworks.com/matlabcentral/profile/authors/5211848-hassan-dehghanitag:nl.mathworks.com,2005:Question/2139322015-04-28T07:56:13Z2015-04-28T08:26:47ZError using ==> network.train at 145<p>I got this message which continues as follows:</p><p>Input states are incorrectly sized for network</p><p>matrix must have 4.77087e+008 columns</p><p>----------------------------------------</p><p>I used the following matrix for input</p><p>p <5x4770865></p><p>and for output</p><p>t <1x4770865></p>Amir Eissahttp://nl.mathworks.com/matlabcentral/profile/authors/6465586-amir-eissatag:nl.mathworks.com,2005:Question/2139302015-04-28T07:54:21Z2015-04-28T07:54:21ZMultiple Serial Callback executions<p>Hello,</p><p>I have been working on a UI for some serial devices. The protocol is packet based.Every packet i receive consists of a header( 3 bytes) in which the length of the packet is defined. depending on this i read the rest bytes.</p><p>For this i use the BytesAvailable callback with a callback function in a separate mfile.
Here is a snippet</p><p>Inside the callback of a button</p><pre> handles.s = serial('COM14');
set(handles.s,'BaudRate',115200,'BytesAvailableFcnMode','byte',...
'BytesAvailableFcnCount',3);
set(handles.s,'BytesAvailableFcn', {@UI_DataCallback_Monitor,handles});</pre><p>Inside the callback function</p><pre class="language-matlab">function UI_DataCallback_Monitor(obj,event,handles)
header = fread(obj,3,'uint8');
length=Uint8toUint16(header(2),header(3),0);
data = fread(obj,length,'uint8');
checksum=fread(obj,1,'uint8');
</pre><p>The problem is that as it seems multiple callbacks are being executed for every packet and results in timeout and errors..
I only want the callback to be executed once for each packet.
Any suggestions?</p><p>Thank you</p>P. Chatzhttp://nl.mathworks.com/matlabcentral/profile/authors/6465536-p-chatztag:nl.mathworks.com,2005:Question/2136002015-04-26T07:08:25Z2015-04-28T07:21:57Zneural network how to orgnize the data<p>I have a problem with nn classification ,I have 19 different classes , each class has 20 features and each feature has 200 samples(it could be more in future), how should I orgnize the input matrix ?
is it 20 x (200*19) or (20 *19) x 200 , and the target 1 x (200 * 19) is that right ? or should I use eye() as I read in some answers?
another question is how to decide the most appropirate number of hidden layers(middle layers not input and output) and number of nerouns in each layer ?
the last thing .. neural network provide different results each run .. is it possible to save the best run net configration and use it later to provide the same or approximated results ??</p><p>thanks in advance</p>Lama AlDeenhttp://nl.mathworks.com/matlabcentral/profile/authors/5334716-lama-aldeentag:nl.mathworks.com,2005:Question/2139202015-04-28T07:12:19Z2015-04-28T07:21:22Zconverting numbers to matrix(matrix formation)<p>If I am having some numbers,
e.g</p><p>x=[ 12 12 12 2 2 2 2 3 3 ];</p><p>and now I want to convert into a matrix of 3 * 3.</p><p>Which MATLAB function is suitable for this?</p>tina jainhttp://nl.mathworks.com/matlabcentral/profile/authors/5644128-tina-jaintag:nl.mathworks.com,2005:Question/2139122015-04-28T06:14:03Z2015-04-28T07:17:17ZNeed help writing a code<p>Hello community, this is a problem I have as homework, I have been looking for a way to write this code but I am not sure how to go about this. I am not the best in matlab and need some help. If someone can help me to solve this it would be much appreciated.</p><img src = "/matlabcentral/answers/uploaded_files/29934/chg.png">Daniel Hatabhttp://nl.mathworks.com/matlabcentral/profile/authors/6144210-daniel-hatabtag:nl.mathworks.com,2005:Question/829542013-07-23T19:02:48Z2015-04-28T07:17:01ZVoltage Measurement block error<p>How to remove this error:
Input two of Voltage Measurement block Three-Phase V-I Measurement' is not properly connected to the network.</p>Mahdi Zolfagharihttp://nl.mathworks.com/matlabcentral/profile/authors/4032010-mahdi-zolfagharitag:nl.mathworks.com,2005:Question/2139212015-04-28T07:15:47Z2015-04-28T07:15:47ZHow to remove this error: Input two of Voltage Measurement block upfc' is not properly connected to the network.<p>How to remove this error: 'Input two of upfc Measurement' is not properly connected to the network.and i m getting model error if i m using only two ports.</p>lal mohammedhttp://nl.mathworks.com/matlabcentral/profile/authors/6465448-lal-mohammedtag:nl.mathworks.com,2005:Question/2139192015-04-28T07:02:02Z2015-04-28T07:02:02ZWHAI IS THE MATLAB CODE TO FIND PSNR AND MSE VALUE FOR ORIGINAL IMAGE AND DENOISED IMAGE IN IMAGE PROCESSING<p>WHAI IS THE MATLAB CODE TO FIND PSNR AND MSE VALUE FOR ORIGINAL IMAGE AND DENOISED IMAGE IN IMAGE PROCESSING</p>Abinaya Magudeeswaranhttp://nl.mathworks.com/matlabcentral/profile/authors/6224484-abinaya-magudeeswarantag:nl.mathworks.com,2005:Question/2139072015-04-28T05:56:40Z2015-04-28T06:58:42ZHow to call a function<p>I have a function which is written according to the following table, Somehow the function is wrong,Please help me in correcting it.</p><img src = "/matlabcentral/answers/uploaded_files/29933/def.png"><p>I had written the following code but it is not able to execute the function properly. Please help. Thanks in advance.</p><pre class="language-matlab">function [C] = XORS(A,B)
</pre><pre class="language-matlab">A = cell2mat(A);
B = cell2mat(B);
</pre><pre class="language-matlab">C(A == 'A' & B == 'A') = 'A';
C(A == 'A' & B == 'T') = 'T';
C(A == 'A' & B == 'C') = 'C';
C(A == 'A' & B == 'G') = 'G';
</pre><pre class="language-matlab">C(A == 'T' & B == 'A') = 'T';
C(A == 'T' & B == 'T') = 'A';
C(A == 'T' & B == 'C') = 'G';
C(A == 'T' & B == 'G') = 'C';
</pre><pre class="language-matlab">C(A == 'C' & B == 'A') = 'C';
C(A == 'C' & B == 'T') = 'G';
C(A == 'C' & B == 'C') = 'A';
C(A == 'C' & B == 'G') = 'T';
</pre><pre class="language-matlab">C(A == 'G' & B == 'A') = 'G';
C(A == 'G' & B == 'T') = 'C';
C(A == 'G' & B == 'C') = 'T';
C(A == 'G' & B == 'G') = 'A';
</pre>Abiramihttp://nl.mathworks.com/matlabcentral/profile/authors/5514421-abiramitag:nl.mathworks.com,2005:Question/2138982015-04-28T04:58:49Z2015-04-28T06:52:46ZNested function causes MATLAB crash (2011a)<p>The code is shown below. Do I have too many global variables? Am I missing something here?</p><pre class="language-matlab">function slslaunch()
%dy = zeros(5,1);
%units
tonforce = 9806.65; %convert to newtons
tons = 1/0.00110231; %convert to kg
</pre><pre> %number of engines
N_srb = 2;
N_rs25 = 4;</pre><pre> Isp_srb = 250;
Isp_rs25 = 400; %this is sort of an average
Isp_j2x = 451.5;</pre><pre> T_srb = 1.428*tonforce*N_srb;
T_rs25 = 830*tonforce; %includes 4 rs25's keyboard</pre><pre> T_j2x = 11.2*tonforce;</pre><pre> taub_srb = 128.4; %seconds
taub_rs25 = 476;
taub_j2x = 377;
tau_orbit = 8000; %that sounds about like an orbit, right?</pre><pre> mass_srb_tank = 100.39*tons*N_srb;
mass_srb_fuel = 650.87*tons*N_srb;</pre><pre> mass_rs25_tank = 89.38*tons;
mass_rs25_fuel = 1002.5*tons;</pre><pre> mass_j2x_tank = 22.063*tons;
mass_j2x_fuel = 207.69*tons;</pre><pre> %mass flow rates
mdot_srb = mass_srb_fuel/ taub_srb;
mdot_rs25 = mass_rs25_fuel/taub_rs25;
mdot_j2x = mass_j2x_fuel/ taub_j2x;</pre><pre> mass_interstage = 0*tons;</pre><pre> mass_payload_fairing = 5.638*tons;</pre><pre> mass_payload = 70*tons; </pre><pre> %initial mass
M0 = mass_srb_tank + mass_srb_fuel + ...
mass_rs25_tank + mass_rs25_fuel + ...
mass_j2x_tank + mass_j2x_fuel + ...
mass_interstage + mass_payload_fairing + mass_payload;</pre><pre> %initial conditions
g0 = 9.81;
h0 = 6378e3;
V0 = 0;
gam0 = (90-.01)/180*pi;
x0 = 0;
theta0 = 0;
[t1,y1] = ode45(@launch,[0,taub_srb],[V0,M0,h0,gam0,theta0]);
plot(t1,y1(:,1),'-',t1,y1(:,2),'-.',t1,y1(:,3),'.')</pre><pre> % %y1 = V velocity
% y2 = M total mass
% y3 = h
% y4 = gamma
% y5 = theta
function dy = launch(t,y)
dy = zeros(5,1);
g = g0*(h0/y(3))^2;
dy(1) = ((T_srb + T_rs25)/y(2))-g*sin(y(4)); %(Fsrb + Frs25(main engine))
dy(2) = mdot_srb+mdot_rs25;
dy(3) = y(1)*sin(y(4));
dy(4) = ((-g*cos(y(4))/y(1))+y(1)*cos(y(4))/y(3))*(y(4)/pi*180>80); %controls gamma
dy(5) = y(1)*cos(y(5))/y(3);
[t1,y1] = ode45(@launch,[0,taub_srb],[V0,M0,h0,gam0,theta0]);
plot(t1,y1(:,1),'-',t1,y1(:,2),'-.',t1,y1(:,3),'.')
%[t2,y2] = ode45(@launch2,[taub_srb,t3],[y(;,end)]);
end
end</pre><pre class="language-matlab">%[t,y] = ode45(@launch,[0,taub_srb],[V0,M0,h0,gam0,theta0]);
</pre><pre class="language-matlab">%[t2,y2] = ode45(@launch2,[taub_srb,t3],[y(;,end)]);
</pre><pre class="language-matlab">%need to call ode45 three times for each seperation last output of previous
%ode45 will be initial condition of next ode45
</pre>Thomashttp://nl.mathworks.com/matlabcentral/profile/authors/4721191-thomastag:nl.mathworks.com,2005:Question/2139172015-04-28T06:47:24Z2015-04-28T06:47:24Zhow to connect raspberri pi B+ with matlab without Ehternet??<p>I want to connect my raspberry B+ with matlab,but matlab softwere is on the server.
and there is no other ethernet port on computer. so how i connect this..
pllz guide me .....</p>yogesh nandurkarhttp://nl.mathworks.com/matlabcentral/profile/authors/5464492-yogesh-nandurkartag:nl.mathworks.com,2005:Question/2126512015-04-21T13:57:02Z2015-04-28T06:42:58Zcompile .C file Include library using mex - error LNK2019: unresolved external symbol - for NPTrackingTools<p>Hello
I'm trying to build simple C function with external commands provide by library NPTrackingTools API</p><pre> #include <stdio.h></pre><pre> #include "mex.h"</pre><pre> #include "NPTrackingTools.h"</pre><pre> void mexFunction(int nlhs, mxArray *plhs[],
int nrhs, const mxArray *prhs[])
{
int ret1,ret2,ret3;</pre><pre> ret1=TT_Initialize();
ret2=TT_FinalCleanup();
ret3=TT_Shutdown();</pre><pre> printf("Hello, World! \n");</pre><pre> return 0;
}</pre><p>I tried the following compiler code</p><pre class="language-matlab">mex -v '-Id:\or hirshfeld\onedrive\work control lab aero summer 2014 technio\C_code' '-LD:\or hirshfeld\onedrive\work control lab aero summer 2014 technion\C_code' '-lNPTrackingToolsx64.lib' test_C_compile_with_include_trackingtools.c
</pre><p>I have all files in the same directory "d:\or hirshfeld\onedrive\work control lab aero summer 2014 technio\C_code"</p><p>but the compiler return an error that he can't understand my commands</p><pre> Error using mex
Creating library test_C_compile_with_include_trackingtools.lib and object test_C_compile_with_include_trackingtools.exp
test_C_compile_with_include_trackingtools.obj : error LNK2019: unresolved external symbol __imp_TT_Initialize referenced in
function mexFunction
test_C_compile_with_include_trackingtools.obj : error LNK2019: unresolved external symbol __imp_TT_Shutdown referenced in function
mexFunction
test_C_compile_with_include_trackingtools.obj : error LNK2019: unresolved external symbol __imp_TT_FinalCleanup referenced in
function mexFunction
test_C_compile_with_include_trackingtools.mexw64 : fatal error LNK1120: 3 unresolved externals</pre><p>I tried different variation but still have the same problem, can you help me?</p><p>Thanks</p><p>Or Hirshfeld</p><p>אור הירשפלד</p>Or Hirshfeldhttp://nl.mathworks.com/matlabcentral/profile/authors/5020917-or-hirshfeldtag:nl.mathworks.com,2005:Question/2138732015-04-27T23:40:02Z2015-04-28T06:34:05ZHow to import blanks cells as Nans<p>I have a file (created in excel) with >100k rows and 22 columns. Many of the cells are blanks (not zeros). If I use csvread to import the data Matlab changes the banks to zeros. I cannot first change the blanks to 99999 because excel crashes. Is there a way to make Matlab import the blanks as Nan's?</p>Cristinahttp://nl.mathworks.com/matlabcentral/profile/authors/2706457-cristinatag:nl.mathworks.com,2005:Question/2139152015-04-28T06:32:35Z2015-04-28T06:32:35ZCan target vector of neural network have sum of columns >1?<p>i have 56 classes ( 1 , 2, .....56) as output. i want to define target vector for neural network. I have converted classes into binary and output neurons are now 6. So for each column the value is >1. Is it ok? Can u help me to write a code to convert 6 output into original classes?</p>manisha bharambehttp://nl.mathworks.com/matlabcentral/profile/authors/4472578-manisha-bharambetag:nl.mathworks.com,2005:Question/2139142015-04-28T06:25:17Z2015-04-28T06:25:17ZHow to make array of the expression having symbolic variable?<p>I want to make an array of the expression having symbolic variables in it.</p><pre class="language-matlab">if true
% clc
clear ALL
syms A Epsilon0 k1 k2 e s d R s f T c0 v0 v x y t
An = 0.5*10^(-9);
Epsilon0n = 8.85*10^-12;
k1n = 10;
k2n = 10;
en = 1.6*10^-19;
sn = 1.8*10^(-9);%m gap size%
dn = 3*sn; % total distance
Rn = 1;
c0n=(An*Epsilon0n*k1n)/dn;
</pre><p>t1=0:0.1:5;
fn=1000;
v0n=7.5;
Tn=5/f;
vn=v0n*sin(2*3.14*fn*t1);
plot(t1,vn);</p><pre> inits = 'q(0)=(20*10^(-20)),Q(0)=0';
[q,Q] = dsolve('Dq=((v/R)-(1/R)*(((d*q)+(s*Q))/(c0*d)))','DQ=(((q+Q)/(A*Epsilon0*k1))*s)',inits);
qn1 = vpa(subs(q,{A,Epsilon0,k1,k2,e,s,d,R,c0},{An,Epsilon0n,k1n,k2n,en,sn,dn,Rn,c0n}),8);
qn2=[];
i=1;
while i<3</pre><p>qn2(i)=subs(qn1, v, 4);
i=i+1;
end
end
Like in the above code , my goal is to create a two element array of the expression qn1 which contains symbolic variables. For each iteration of while loop, it creates qn2(i) array having the expression calculated from qn1 but in that symbolic expression, the v is replaced by 4.</p><p>I am getting the error given below.</p><p><b>"If the input expression contains a symbolic variable, use the VPA function instead."</b></p>AK Khanhttp://nl.mathworks.com/matlabcentral/profile/authors/6221608-ak-khantag:nl.mathworks.com,2005:Question/2138802015-04-28T01:22:11Z2015-04-28T06:23:43ZMatlab installation on ubuntu 14.04<p>I downloaded license version of matlab from mathworks.com with a Linux version for Ubuntu 41.04. Our license is network license. How do I run license service of matlab on ubuntu. How do I install clients, how do I open/run matlab on client. How do I check flexlm for Ubuntu 14.04.</p>Kasihttp://nl.mathworks.com/matlabcentral/profile/authors/750073-kasitag:nl.mathworks.com,2005:Question/2136492015-04-26T17:56:01Z2015-04-28T06:23:03ZSolving non-linear system of equations<p>Hi</p><p>I am working on a Matlab code involving enzyme kinetics. The problem statements gives a series of enzyme reactions where molecules are dependent of one another. I have used the dsolve command to solve for each molecule's concentration as a function of time. And I also substituted in all the constants. Now, I am left with five equations with five different unknowns. What command can I used to solve these systems of equations?</p><p>The following is what I have so far</p><p>Ai = 3;</p><p>Bi = 2;</p><p>Ci = 0;</p><p>Si = 0.5;</p><p>Fi = 1;</p><p>k1 = 0.1;</p><p>k2 = 0.2;</p><p>k3 = 0.3;</p><p>k4 = 0.4;</p><p>k5 = 0.5;</p><p>t = (0:0.4:40);</p><p><i>__</i></p><p>syms A B C S F</p><p>syms k_1 k_2 k_3 k_4 k_5</p><p>syms Ao Bo Co So Fo</p><p>A = dsolve('DA == (-k_1*A)+(k_2*S^2)+(k_3*C*S)-(k_4*A^2)','A(0) = Ao','t');</p><p>B = dsolve('DB == (k_1*A)+(k_2*S^2)','B(0) = Bo','t');</p><p>C = dsolve('DC == (-k_3*C*S)+(k_4*A*A)','C(0) = Co');</p><p>S = dsolve('DS == (-k_2*S*S)-(k_3*C*S)+(k_4*A*A)-(k_5*S)', 'S(0) = So','t');</p><p>F = dsolve('DF == (-k_5*S)', 'F(0) = Fo','t');</p><p><i>__</i></p><p>A = subs(A, {k_1,k_2,k_3,k_4,k_5,Ao},{k1,k2,k3,k4,k5,Ai});</p><p>B = subs(B, {k_1,k_2,k_3,k_4,k_5,Bo},{k1,k2,k3,k4,k5,Bi});</p><p>C = subs(C, {k_1,k_2,k_3,k_4,k_5,Co},{k1,k2,k3,k4,k5,Ci});</p><p>S = subs(S, {k_1,k_2,k_3,k_4,k_5,So},{k1,k2,k3,k4,k5,Si});</p><p>F = subs(F, {k_1,k_2,k_3,k_4,k_5,Fo},{k1,k2,k3,k4,k5,Fi});</p><p>Thank you for any assistance.</p><p>Best</p>x coosehttp://nl.mathworks.com/matlabcentral/profile/authors/6453431-x-coose