http://de.mathworks.com/matlabcentral/answers/questions.atomMATLAB Answers — New Questions2016-05-28T15:59:43Ztag:de.mathworks.com,2005:Question/2862162016-05-28T15:59:43Z2016-05-28T15:59:43ZError for access denined... change the directory... please help me.. please..<p>Hello,
when i trying to run the .m file in MATLAB/simulink through MATLAB function block..
i get the following error..
"The current directory 'c:\program files\matlab\r2013a\bin' is reserved for MATLAB files.</p><pre> Please change your current directory to a writeable directory outside of the MATLAB installation area."</pre><p>lots of directory path change like "C:\Users\Bhagchand\Documents"
...
after changing the directory path getting this type of results...
Making simulation target "check_sfun", ...</p><p>"'check_sfun.bat' is not recognized as an internal or external command,
operable program or batch file."</p><p>please help me...
please...</p><p>also attach the two error image here..</p><p>Thank you....</p>Dr. Ragav Bhatthttp://de.mathworks.com/matlabcentral/profile/authors/6882574-dr-ragav-bhatttag:de.mathworks.com,2005:Question/2861972016-05-28T12:16:14Z2016-05-28T15:53:49ZIndex of element to remove exceeds matrix dimensions??!<p>Hello Everybody;
i am having a problem with that code, regarding that i want to discards the columns with value less than 3...but it always gives me Index of element to remove exceeds matrix dimensions</p><p>can you please help me through that?!</p><pre> [orderedCount, SortOrder]=sort(Count,'descend');
Items=Items(SortOrder);
%%% the propabilty of presence of each
for i=1:length(orderedCount)
if(orderedCount(i)<3)
items(i)=[];
end
end</pre>Mariam Shehahttp://de.mathworks.com/matlabcentral/profile/authors/2931683-mariam-shehatag:de.mathworks.com,2005:Question/2861662016-05-28T05:28:54Z2016-05-28T15:52:32ZIt's a little bit weird.<p>It's a little bit weird... I wrote appDer(0,delta) < 0.01 but</p><pre class="language-matlab">f = @(t) t.^3;
appDer = @(t, dt) (f(t+dt)- f(t))/dt;
for delta = 1 : -0.001 : 0
if appDer(0,delta) < 0.01
break
end
end
disp([delta,appDer(0,delta)])
0.1000 0.0100
</pre><p>But...</p><pre> f = @(t) t.^3;
appDer = @(t, dt) (f(t+dt)- f(t))/dt;
for delta = 1 : -0.001 : 0
if appDer(0,delta) < 0.0099999
break
end
end
disp([delta,appDer(0,delta)])
0.0990 0.0098</pre><p>Why does it happen?
Frankly, I can assume the reason, but I want to know about it, exactly.
If possible, please give me the answer in Korean.</p>Young-hoon Kanghttp://de.mathworks.com/matlabcentral/profile/authors/6901523-young-hoon-kangtag:de.mathworks.com,2005:Question/2259172015-06-30T13:34:36Z2016-05-28T15:51:01ZSample time Propagation Error - The sample time after propagation is [0, 0]. Enter a discrete sample time<p>Hello,</p><p>I'm getting the following error,</p><p><b><i>The sample time after propagation is [0, 0]. Enter a discrete sample time in ....... Zero-Order Hold1</i></b></p><p>I checked the entire model, all blocks have a sample time of 0.01 or -1(inherited) and also there are no continuous states within the model. I'm not sure why this error is coming up.</p><p>The above error points to Zero-Order Hold block which has a sample time of -1 (inherited), if I change that to 0.01 the simulation is running, but there are lot of places within my model which has inherited sample time changing each and every block would be cumbersome.</p><p>I appreciate any suggestion to overcome this issue.</p><p>Thank you!</p><p>Vignesh</p>Vignesh Venkatachalamhttp://de.mathworks.com/matlabcentral/profile/authors/6528309-vignesh-venkatachalamtag:de.mathworks.com,2005:Question/2862152016-05-28T15:40:05Z2016-05-28T15:40:05Zoutput of a neural network based on interrelationship between two or more networks <p>Hello is it possible to build two different neural networks and then with the help of a common input we get an output that comes after it satisfies some relation between those two different network?</p><p>For eg:</p><p>I create a simple feed forward network for recognising speech.The another feed forwardnet has been trained to recognise the speech quality(loud,low etc).Based on the out put of the second one their is some effect on the out put of the first.</p><p>Some how I just want to prepare a data in two diffenrt forms of input send it to two different nets...related both of their outputs and then get a common output.
is it possible? Can any sort of neuro fuzzy system be created ?</p>AKhttp://de.mathworks.com/matlabcentral/profile/authors/6636409-aktag:de.mathworks.com,2005:Question/2862112016-05-28T15:21:49Z2016-05-28T15:39:55ZHow to convert a mixed array to cell array<p>Hi,</p><p>I have a mixed array (cell, numeric, string), but I eventually want to convert all to cell. Can any one tell how to do this.</p><p>Thanks,</p>Kanakaiah Jakkulahttp://de.mathworks.com/matlabcentral/profile/authors/6734702-kanakaiah-jakkulatag:de.mathworks.com,2005:Question/2861792016-05-28T08:40:47Z2016-05-28T15:34:47ZHow to design filter using FIR bandpass filter with cutoff frequency 17Hz and 30Hz and IIR lowpass filter with cutoff frequency 25Hz?<p>design filter by using matlab</p>SYAZWANI IBRAHIMhttp://de.mathworks.com/matlabcentral/profile/authors/8255924-syazwani-ibrahimtag:de.mathworks.com,2005:Question/2862142016-05-28T15:31:55Z2016-05-28T15:31:55ZVirtual reality : Rotation Roll Pitch Yaw<p>Hi,</p><p>I want to rotate a 3D model satellite along the cardan angles (roll pitch yaw) that are <b>intrinsic</b> to the satellite.</p><p>See this example :</p><img src = "https://upload.wikimedia.org/wikipedia/commons/thumb/c/c1/Yaw_Axis_Corrected.svg/2000px-Yaw_Axis_Corrected.svg.png"><p>I want to do Roll rotation 1st, than Pitch second and Yaw third.
The roll rotation is simple.</p><pre> satellite.rotation=[1, 0, 0, roll angle]</pre><p>The problem is for the second rotation. As I said, the pitch axis is intrinsic to the satellite so during the roll rotation, the pitch axis as changed so I can't type</p><pre> satellite.rotation=[0, 1, 0, pitch angle]</pre><p>Because [0, 1, 0] refers to the VRML world axis.</p><p>My question is <b>how to store the rotated satellite to apply to him the Pitch rotation</b></p>Kilian Lowhttp://de.mathworks.com/matlabcentral/profile/authors/8129904-kilian-lowtag:de.mathworks.com,2005:Question/2862132016-05-28T15:26:17Z2016-05-28T15:26:17Zhow can I cite MATLAB software in APA style? <p>I want to add a citation of the software to an academic project due to my psychology studies.
Need it to be APA style.</p><p>Thank's,
Tal.</p>tal brondvinehttp://de.mathworks.com/matlabcentral/profile/authors/7933446-tal-brondvinetag:de.mathworks.com,2005:Question/2862122016-05-28T15:22:48Z2016-05-28T15:22:48ZSearching for a method to compute centroid of FEM-package<p>Hello,</p><p>I'm doing a Finite Element Method (FEM) analysis of the frame of a pedicab. To find the reaction moment when the bike brakes, I need to know where the center of gravity or centroid is positioned.</p><p>Does anyone know how to compute the centroid of the whole construction? Maybe someone who has a script which can help me? Of searched for one but I couldn't find one.</p><p>Kind regards,</p><p>Thomas</p>Thomas de Langehttp://de.mathworks.com/matlabcentral/profile/authors/8239732-thomas-de-langetag:de.mathworks.com,2005:Question/2862102016-05-28T15:20:31Z2016-05-28T15:20:31Zhow do create the model of the led in visible light communication ?<p>how do create the model of the LED in visible light communication ?</p>mahdi najibhttp://de.mathworks.com/matlabcentral/profile/authors/8256888-mahdi-najibtag:de.mathworks.com,2005:Question/2862092016-05-28T15:15:28Z2016-05-28T15:15:28ZQuestion about choosing an initial state error covariance for Kalman filter<p>Hi Everyone,</p><p>I have a Kalman filter code from internet, which estimates states of following state space system:</p><p>x(k+1)= A x(k) + w(k); y(k)= C x(k);</p><p>Before the code starts to perform the Kalman filter, it initializes the initial state error covariance P(0) as</p><pre> P{0}= reshape( (eye(n^2)-kron(A,A) ) \ Q(:), n, n );</pre><p>where n is the size of state, Q is the covariance of white Gaussian noise w(k).</p><p>Does anyone have a clue why the code initialize the P(0) like this?</p><p>Thanks</p>Minghttp://de.mathworks.com/matlabcentral/profile/authors/3388908-mingtag:de.mathworks.com,2005:Question/2862082016-05-28T15:06:26Z2016-05-28T15:06:26ZHow do I close crop a face?<p>Hello everyone,</p><p>I am a student who are new to MATLAB. I need help on the codes and algorithms on how to close crop a face after the face detection process. Your help is very much appreciated !</p>Mansell Tehhttp://de.mathworks.com/matlabcentral/profile/authors/8146572-mansell-tehtag:de.mathworks.com,2005:Question/2862072016-05-28T15:05:42Z2016-05-28T15:05:42Zhow do create the model of the led in visible light communication ?<p>how do create the model of the led in visible light communication ?</p>mahdi najibhttp://de.mathworks.com/matlabcentral/profile/authors/8256888-mahdi-najibtag:de.mathworks.com,2005:Question/2861592016-05-28T03:31:55Z2016-05-28T15:02:45ZFunction handle is giving wrong results!<p>This code is clearly giving wrong results:</p><pre class="language-matlab">clc;clear all
a0 = 2;
a1 = 2;
y = [1 1.4 2.3];
x = [1 2 3];
f = @(x,a0,a1) (a0.*x)/(a1+x);
partialf_a0 = @(x,a1) (x./(x+a1));
partialf_a1 = @(x,a0,a1) (-(a0.*x)/((a1+x).^2));
partialf_a0(a1,x)
partialf_a1(x,a0,a1)
f(x,a0,a1)
</pre><p>Substituting a0 and a1 with their values into the equations, gives correct results for partialf_a0:</p><pre class="language-matlab">clc;clear all
a0 = 2;
a1 = 2;
y = [1 1.4 2.3];
x = [1 2 3];
f = @(x,a0,a1) (a0.*x)/(a1+x);
partialf_a0 = @(x,a1) (x./(2+x));
partialf_a1 = @(x,a0,a1) (-(a0.*x)/((a1+x).^2));
partialf_a0(x)
partialf_a1(x,a0,a1)
</pre>Ahmadhttp://de.mathworks.com/matlabcentral/profile/authors/6024139-ahmadtag:de.mathworks.com,2005:Question/2862062016-05-28T15:01:46Z2016-05-28T15:01:46ZCan't connect MATLAB 2016 to Arduino using arduino() function ??<p>Hi,
I am working on a servo motor that's gonna receive an angle value from matlab. Previously we were using arduino ide but there were problems in creating an arduino serial communication. Then we began using serial communication with arduino built-in function in matlab 2016.</p><p>But problem did not go away. Even a few minutes ago, the servo was doing the job. Then when we ran the program again, this popped up, again,</p><p>" <b>Failed to open serial port COM5 to communicate with board Mega2560. Make sure there is no other MATLAB
arduino object for this board. For troubleshooting, see Arduino Hardware Troubleshooting.</b>"</p><p>This has been really frasustrating ! Please guyz, anyone have any idea what went wrong here or how to solve it ??</p><p>Thanks in advance.</p><pre class="language-matlab">if true
%
a=arduino();
s=servo(a,'D9');
angle=30/180;
writePosition(s,angle);
</pre><pre class="language-matlab">end
</pre>Kazihttp://de.mathworks.com/matlabcentral/profile/authors/4107972-kazitag:de.mathworks.com,2005:Question/2862052016-05-28T14:59:27Z2016-05-28T14:59:27ZSonar/Radar tracking with Kalman filter<p>Can i find somewhere code where i can just put my radar/sonar data and run program?
I found some exampels but i couldnt change data.
I need just basic program.</p><p>Examples i found:
https://www.mathworks.com/examples/simulink/mw/simulink_product-sldemo_radar_eml-radar-tracking-using-matlab-function-block</p><p><a href = "http://www.mathworks.com/help/dsp/examples/estimating-position-of-an-aircraft-using-kalman-filter.html">http://www.mathworks.com/help/dsp/examples/estimating-position-of-an-aircraft-using-kalman-filter.html</a></p>Ivan Kutsurahttp://de.mathworks.com/matlabcentral/profile/authors/7956455-ivan-kutsuratag:de.mathworks.com,2005:Question/2400362015-09-05T13:36:42Z2016-05-28T14:54:59ZHave anyone an idea or trying to model the distance/impedance relay by MATLAB M-file? <p>How can I plot R-X diagram of distance relay characteristics with Zone specifications,i.e specifying Zone1, Zone2 and zone 3 ?</p><p>Please anyone guide me how do I model the distance/impedance relay by MATLAB M-file? or Can anyone share MATLAB code (in M-file) for distance/impedance relay?</p>mohammed elgamalhttp://de.mathworks.com/matlabcentral/profile/authors/5102886-mohammed-elgamaltag:de.mathworks.com,2005:Question/2220982015-06-02T14:33:20Z2016-05-28T14:53:54Zhow can I simulate distance relay to protect HVDC transmission line and distance relay m.file code in matlab<p>i need the simulation of distance relay in matlab for HVDC transmission line protection and it's m.file</p>heba mahmoudhttp://de.mathworks.com/matlabcentral/profile/authors/6516076-heba-mahmoudtag:de.mathworks.com,2005:Question/2862042016-05-28T14:49:57Z2016-05-28T14:49:57ZCan I use ginput (or an analog) in the 2016a App Designer?<p>Is there a way to use the ginput function (https://www.mathworks.com/help/matlab/ref/ginput.html) in the new App Designer? Or is there another function that allows you to generate points by clicking on parts of an Axes (Line and Scatter)? For reference, I would like to be able to do something like this:</p><pre class="language-matlab">function startupFcn(app)
%uiopen
app.xdata = linspace(0, 3*pi, 10);
app.ydata = cos(app.xdata) + rand(1, 10);
plot(app.UIAxes, app.xdata, app.ydata, 'Linewidth',.7);
[x,y] = ginput(2);
end
</pre><p>Thank you!</p>alexhttp://de.mathworks.com/matlabcentral/profile/authors/5561609-alextag:de.mathworks.com,2005:Question/2862032016-05-28T14:43:19Z2016-05-28T14:43:19Zhow to implement the impedance control algorithm in matlab for the manipulator?<p>MATLAB code needed to implement impedance control on the manipulator</p>Mohammad AKhttp://de.mathworks.com/matlabcentral/profile/authors/7446124-mohammad-aktag:de.mathworks.com,2005:Question/332962012-03-23T23:17:34Z2016-05-28T14:39:41Zranking (ordering) values with repeats<p>Hello Community,</p><p>Im hoping some of you have a clever solution to this problem. Im looking for fast and efficient way to rank (order)a vector of numbers in a particular way when repeated values arise.</p><p>To make it simple, suppose I have a row vector:</p><pre class="language-matlab">data = [-1 2 0 -2 0]
</pre><p>I know I can rank them using the 3rd output of "unique":</p><pre class="language-matlab">>> [~,~,rnk] = unique(data)
</pre><pre class="language-matlab">rnk =
</pre><pre> 2 4 3 1 3</pre><p>What I like about this is that it assigns the same rank to the repeated zeros. What I don't like about this is that the top rank is now "4" even though I have 5 values. I would prefer this:</p><pre class="language-matlab">>> rnk = myrank(data)
</pre><pre class="language-matlab">rnk =
</pre><pre> 2 5 3 1 3</pre><p>Ive also played around with the second output of "sort" quite a bit, but since this output produces indicies of the sorted values within the original array, there is no simple way (that I've found) to associate the same rank with repeated values.</p><p>Im just wondering if there is something simple that Im missing.</p><p>Thanks!</p>owrhttp://de.mathworks.com/matlabcentral/profile/authors/2695663-owrtag:de.mathworks.com,2005:Question/2862022016-05-28T14:17:22Z2016-05-28T14:37:43Zhow to fix my guide m file <p>hello, i am creating an interface using guide but when i write the axes program it keeps indicating this error "Error in @(hObject,eventdata)interfac('pushbutton_Callback',hObject,eventdata,guidata(hObject))""....can someone explain it or how can i fix it
Thanks</p>rahmoune wisshttp://de.mathworks.com/matlabcentral/profile/authors/5025161-rahmoune-wisstag:de.mathworks.com,2005:Question/2862002016-05-28T12:40:57Z2016-05-28T14:34:35ZVideo processing tracking two points <p>I am trying to detect two points on a gray surface and then track their position throughout the video. I tried the KLT and it was not working giving me an error and the points are not being detected because it is a gray picture and the two points are dark. What method should I try?</p>Mhttp://de.mathworks.com/matlabcentral/profile/authors/4636488-mtag:de.mathworks.com,2005:Question/2861702016-05-28T06:06:22Z2016-05-28T14:24:37Zhow to connect very disconnected pixels in an binary image ?<p>Hello !
I am trying to connect the edges of my 'im.png' (binary image) ..I have tried imfill,Edge Linking and Line Segment Fitting by Peter,bwconnect ,,but it is not helpful at all ... i want to have image like 'mJPCLN001.png'</p><p>If someone can help me by providing a code or give me some suggestion for how to link edges in my image,,ill be very obliged ..</p><p>Best regards</p>mahreen kiranhttp://de.mathworks.com/matlabcentral/profile/authors/6746274-mahreen-kirantag:de.mathworks.com,2005:Question/2861712016-05-28T06:39:06Z2016-05-28T14:23:23ZRemoving water drops on leaf<p>I want to remove the water drops in this image. I am new to image processing and matlab and would be glad if i could get help!</p>Praneetha C Khttp://de.mathworks.com/matlabcentral/profile/authors/8197735-praneetha-c-ktag:de.mathworks.com,2005:Question/2853572016-05-22T14:51:40Z2016-05-28T14:22:53Zdesign FIR bandpass filter<p>cutoff frequency, fc1 = 10 Hz and fc2 = 40 Hz</p>Mr Khttp://de.mathworks.com/matlabcentral/profile/authors/8229108-mr-ktag:de.mathworks.com,2005:Question/2861722016-05-28T07:50:11Z2016-05-28T14:21:54Zhello every body, I want to ask about how to repeat this equation by iteration in image processing in matlab:<p>x(K+1)=x(k)+b(c-d*x(k)).
I hope some one answer .</p>hala halahttp://de.mathworks.com/matlabcentral/profile/authors/8219773-hala-halatag:de.mathworks.com,2005:Question/2861782016-05-28T08:32:19Z2016-05-28T14:19:31Zhow to generate all possible combination from a sequence<p>how to generate all possible combination from a n-dimensional vector without repetition of numbers.. i wanted combination of vec = 1:11;</p><p>eg:</p><pre class="language-matlab">vec = [1 2 3]
result = [
1 2 3;
1 3 2;
2 3 1;
2 1 3;
3 2 1;
3 1 2];
</pre>Elysi Cochinhttp://de.mathworks.com/matlabcentral/profile/authors/3625227-elysi-cochintag:de.mathworks.com,2005:Question/2861842016-05-28T09:00:12Z2016-05-28T14:18:20Zhybrid featur extraction technique<p>hi, i want to extract the features by using two feature extraction technique that is LBP features and Gabor features is this is suitalbe for script identification. in document image analysis.</p><p>thanks in advance</p>SATISH KUMARhttp://de.mathworks.com/matlabcentral/profile/authors/7481497-satish-kumartag:de.mathworks.com,2005:Question/2860462016-05-27T07:55:33Z2016-05-28T14:17:14Zdraw min squares in black and white<p>Hi every</p><p>I want to plot min squares in black and white like the attachment</p><p>I had an idea (I didn't try it that i make the 3-dim image matrices)</p><p>Is there other solutions???</p>Ahmed raafathttp://de.mathworks.com/matlabcentral/profile/authors/6711425-ahmed-raafattag:de.mathworks.com,2005:Question/180142011-10-11T14:23:58Z2016-05-28T14:16:22Zmle with cdf<p>Hi</p><p>I was wondering if someone can shed light on mle with cdf. It always returns two estimates, regardless of of how many parameters you have. Moreover,the second estimate is the std of the input. e.g. If you run the following:</p><p>r = randn(100,1)*20+10;</p><p>pdf_norm = @(x,mu) = normpdf(x,mu,20);</p><p>cdf_norm = @(x,mu) = normcdf(x,mu,20);</p><p>[p1,c1]=mle(r,'pdf',pdf_norm,'start',5);p1</p><p>[p2,c2]=mle(r,'cdf',cdf_norm);p2</p><p>you see that p2 has two elements, when it should have only 1. What is the correct way of using mle with cdf if you do NOT have a pdf? How do you use mle with cdf if you have to estimate more than one parameter?</p><p>Thanks,</p>Peon Pionhttp://de.mathworks.com/matlabcentral/profile/authors/3110302-peon-piontag:de.mathworks.com,2005:Question/2861882016-05-28T10:09:18Z2016-05-28T14:08:54ZHow to extract color feature from an image.<p>I want to extract color features from image which can helps me to recognize color. if any one who already working on this. I'm looking forwards for your positive response . thanks</p>Sayyad Shahhttp://de.mathworks.com/matlabcentral/profile/authors/7926050-sayyad-shahtag:de.mathworks.com,2005:Question/2861892016-05-28T11:17:50Z2016-05-28T14:06:16ZCompare snr of quantized signals <p>Hi,</p><p>i should write some functions (calculate_snr and quantize) and then write a script that calculates the snr of quantized signals with 2-16 quantization bits.
So i wrote them functions quantize (parameters: f: signal and n: quantization bits) and calculate_snr where I applied a random noise to the signal and return the snr between noisy signal and the orignal one.</p><p>Both functions here:</p><pre class="language-matlab">function [snr] = calculate_snr( f,n )
%CALCULATE_SNR Summary of this function goes here
% calc snr in db
% SNR = 10 log (S/N) from script
% generate noisy signal
%noise standard deviation
noisy = n*randn(size(f)); %noisy signal
snr = 10 * log(f/noisy);
end
</pre><p>The other one:</p><pre class="language-matlab">function f_q = myquantization( f, b)
max_steps= 2^b;
f_m = max(f)-min(f);
delta_q = f_m/(max_steps-1);
q = min(f):delta_q:max(f);
f_q = zeros(size(f));
for i=1:length(f)
[~,index_min] = min(abs(q-f(i)));
f_q(i) = q(index_min);
end
end
</pre><p>These functions work pretty well so far. But when I create an array and hold the results of calculations in this array and plot it over the quantization bits, I just dont see the result I was bein expecting.
I expected that the signal is increasing as the SNR gets better with every bit (which I adjust in the quantization?).
Instead, this is my result.</p><img src = "/matlabcentral/answers/uploaded_files/53220/res.jpg"><p>Here is how I generate it. I know I could probably do it a lot easier.</p><pre> generate sine signal
[f,t] = sinusGenerator(1,3,0,0,1,0.001);
%Sine signal quantization
% quant bits 2-16
f_q2 = myquantization(f, 2);
f_q3 = myquantization(f, 3);
f_q4 = myquantization(f, 4);
f_q5 = myquantization(f, 5);
f_q6 = myquantization(f, 6);
f_q7 = myquantization(f, 7);
f_q8 = myquantization(f, 8);
f_q9 = myquantization(f, 9);
f_q10 = myquantization(f, 10);
f_q11 = myquantization(f, 11);
f_q12 = myquantization(f, 12);
f_q13 = myquantization(f, 13);
f_q14 = myquantization(f, 14);
f_q15 = myquantization(f, 15);
f_q16 = myquantization(f, 16);
% vector for snr results
f_snr = zeros(1,15);
f_snr(1) = calculate_snr(f_q2, 0.07);
f_snr(2) = calculate_snr(f_q3, 0.07);
f_snr(3) = calculate_snr(f_q4, 0.07);
f_snr(4) = calculate_snr(f_q5, 0.07);
f_snr(5) = calculate_snr(f_q6, 0.07);
f_snr(6) = calculate_snr(f_q7, 0.07);
f_snr(7) = calculate_snr(f_q8, 0.07);
f_snr(8) = calculate_snr(f_q9, 0.07);
f_snr(9) = calculate_snr(f_q10, 0.07);
f_snr(10) = calculate_snr(f_q11, 0.07);
f_snr(11) = calculate_snr(f_q12, 0.07);
f_snr(12) = calculate_snr(f_q13, 0.07);
f_snr(13) = calculate_snr(f_q14, 0.07);
f_snr(14) = calculate_snr(f_q15, 0.07);
f_snr(15) = calculate_snr(f_q16, 0.07);
x_axis = linspace(2,16,15);
plot(x_axis, f_snr)</pre><p>Please excuse my English and I hope someone can help me out.</p>David Bolthttp://de.mathworks.com/matlabcentral/profile/authors/7963758-david-bolttag:de.mathworks.com,2005:Question/2861962016-05-28T12:15:14Z2016-05-28T14:00:33ZHow to plot this function in matlab?<p>x=e^((y-b)/a)</p>Ahmadhttp://de.mathworks.com/matlabcentral/profile/authors/6024139-ahmadtag:de.mathworks.com,2005:Question/674952013-03-17T02:41:14Z2016-05-28T13:58:41ZPutting spaces between strings?<p>I have three different strings and are putting them together in an array. The result is simply the three strings combined. However, I want to put spaces between each string. I tried doing this:</p><pre class="language-matlab">a = 'str1'
b = 'str2'
c = 'str3'
</pre><pre class="language-matlab">x = [a,'',b,'',c]
</pre><p>but that doesn't do anything so how would I put spaces then?</p>Joehttp://de.mathworks.com/matlabcentral/profile/authors/4095946-joetag:de.mathworks.com,2005:Question/2861902016-05-28T11:20:50Z2016-05-28T13:58:28ZHow to plot two graphs generated by different files together on the same axis?<p>I have a code which accepts one audio file as input. I have to compare the results of 2 audio files on the same graph. I can't use hold on and hold off here as the same code is being run separately. So I give input as the first audio file and get a graph, and then I give second audio file as input and get another graph. How am I supposed to see the result on the same axis in 2 colours?</p>Staylhttp://de.mathworks.com/matlabcentral/profile/authors/7800095-stayltag:de.mathworks.com,2005:Question/926342013-01-03T19:04:00Z2016-05-28T13:57:48ZWhy do I get a connection error when installing or activating MATLAB or another MathWorks product?<p>I get an error that I cannot connect to MathWorks when running the MATLAB installer or the activation client. However, I can access the website. Why can't the activation client connect to the MathWorks?</p>MathWorks Support Teamhttp://de.mathworks.com/matlabcentral/profile/authors/4622813-mathworks-support-teamtag:de.mathworks.com,2005:Question/2861572016-05-28T03:00:47Z2016-05-28T13:55:30ZHow to take a common particular part of string<p>Hi,</p><p>I have the below cell array. Please some one help me how to do this.</p><pre class="language-matlab">PR.VK0K200E5T00_T123
PR.VBK0K800E3F00_R243
PR.VP124K800E5T00
PR.ZVK0K10E5T00_T123_FF99
</pre><p>My output is below.</p><pre class="language-matlab">200E5
800E3
800E5
10E5
</pre><p>Many thanks in advance.</p>Mekala balajihttp://de.mathworks.com/matlabcentral/profile/authors/5786945-mekala-balajitag:de.mathworks.com,2005:Question/2861932016-05-28T11:57:42Z2016-05-28T13:54:56ZHow to insert multiple legends in a figure<p>Hi guys,
I need some help.</p><img src = "/matlabcentral/answers/uploaded_files/53221/sample_img.png"><p>In the above shown figure, I want to create two seperate legends.
First legend to specify the type of line. i.e solid lines(some1) and dotted lines(some2)
Second legend to differentiate between the colours.</p><p>Could someone help me to do this stuff. I am bit confused.</p><p>Thanks in advance
Korada</p>SRIHARSHA KORADAhttp://de.mathworks.com/matlabcentral/profile/authors/5810199-sriharsha-koradatag:de.mathworks.com,2005:Question/2860122016-05-26T21:12:20Z2016-05-28T13:49:29ZDigital number reading and extraction from images?<p>Hi. I want to extract digits from given test image. I'm having problem with
1) Perfect binarization.
2)image preprocessing.
3)Digit extraction algorithm.
I've tried carplate extraction algorithm but its not working here. Anyone worked in this type of problem then please help and if possible share code. I've shared the image below.</p>Shrikanthttp://de.mathworks.com/matlabcentral/profile/authors/8205178-shrikanttag:de.mathworks.com,2005:Question/2861982016-05-28T12:24:37Z2016-05-28T13:43:44ZIs it possible to save the whole text of the command window at the end of a run?<p>I dont want to use fprintf twice to write on the command window and into a text file. Is it possible to write only on the command line, but at the end save somehow the whole previous output texts?</p>Mr M.http://de.mathworks.com/matlabcentral/profile/authors/4980938-mr-mtag:de.mathworks.com,2005:Question/2861492016-05-27T23:20:31Z2016-05-28T13:42:00ZHow can I convert data from a line figure to binary?<p>Hello again. I have the following line plot. Instead of that I want to create an image which will be consisted of pixel data. To be more specific I want the data to be binary and value '1' should match each pair (x,y) for each line (there are 25 lines plotted in the graph below)and value '0' everything else . I have extracted all data from the graph and they are in cell form (xdata cell 25x1 and ydata cell 25x1). Is it possible to be done? Thanks in advance.</p><img src = "/matlabcentral/answers/uploaded_files/53194/a.jpg">Paschalis Garouniatishttp://de.mathworks.com/matlabcentral/profile/authors/8184349-paschalis-garouniatistag:de.mathworks.com,2005:Question/2861422016-05-27T21:43:57Z2016-05-28T13:34:34Zrecord audio and get data in real time<p>Hello,
i want to make a recorder in real time, and i get data every 0.01 second with recording parameters(Fs = 8000, nbits = 16 bits, nbChannel = 1), so i want to get the 80 samples (every 0.01) second to analyse them and apply my work.
i used audiorecorder object but no result, when i try to get data it is empty.
Thank you</p>dz despehttp://de.mathworks.com/matlabcentral/profile/authors/6345621-dz-despetag:de.mathworks.com,2005:Question/2861992016-05-28T12:33:59Z2016-05-28T13:22:01Zhow to change one element in a matrix using if statement inside the for loop<p>hello everyone,
I have a matrix inside a for loop and I need to change one of the element of this matrix by using if else.
How can I do that?</p><p>regards</p>Hussam Jabbarhttp://de.mathworks.com/matlabcentral/profile/authors/7026914-hussam-jabbartag:de.mathworks.com,2005:Question/2862012016-05-28T13:10:17Z2016-05-28T13:47:24ZHow to model noise-free case and to obtain Covarince matrix after performing Gaussian process regression using fitrgp<p>Assume that there is a GP model constructed using D = {X, y} with fitrgp function, such that:
gprMdl = fitrgp(data.X, data.Y, 'KernelFunction', 'ardsquaredexponential', 'BasisFunction', 'none', 'verbose', 1, 'FitMethod',exact')</p><p>I have several question as follows:</p><p>1) In introduction of GPR, it says GPR can be used to model the noise and noise-free cases (two present figures in Gaussian Process Regression Models page of MATLAB). But I didn't find how to model noise-free (deterministic) case with fitrgp function.</p><p>2) How can I get the auxiliary terms (such as covarince matrix C=K(X,X), and its inverse) that are already used when training GPR? I know we can calculate them by ourselves, but if matlab can produce them or not according to users' selection, it may be better.I need these auxiliary terms to do things else.</p><p>HP</p>Academic learninghttp://de.mathworks.com/matlabcentral/profile/authors/8119875-academic-learningtag:de.mathworks.com,2005:Question/52002011-04-10T22:43:30Z2016-05-28T12:42:08ZUndefined function or method '...' for input arguments of type 'double'.<p>I'm getting the following error when I try to run some function m-files:
??? Undefined function or method '[name of function]' for input arguments of type 'double'.</p>
<p>I know this usually happens when the file isn't in the working directory, but that's not the case here.</p>
<p>When I was running these m-files in a different directory on my computer, it worked fine. I moved them to another directory on my laptop, and they're still fine, but I get this error on two of my desktops.</p>
<p>Thank you.</p>Dhttp://de.mathworks.com/matlabcentral/profile/authors/1466466-dtag:de.mathworks.com,2005:Question/2861942016-05-28T12:08:03Z2016-05-28T12:08:03ZExponential power delay/decay channel<p>If I want my channel gain to resemble an exponential power delay profile is it enough to define:</p><pre class="language-matlab">h= [1 0.66]
</pre><p>if I have two channel taps (i.e memory length of 2) and</p><pre class="language-matlab">h= [1 0.66 0.44]
</pre><p>for three taps? or is it more complicated than that?</p><p>----------------------</p><p>I found this vector</p><pre> [1 0.66 0.44 0.29 0.13 0.05] </pre><p>when googling "exponential power delay profile" source: <a href = "http://www.mathworks.com/matlabcentral/newsreader/view_thread/67532">http://www.mathworks.com/matlabcentral/newsreader/view_thread/67532</a></p><p><i>I am trying to simulate an optical channel (wireless).. so <b>h</b> must be real and deterministic (not random)</i></p>MatlabGirlhttp://de.mathworks.com/matlabcentral/profile/authors/4081947-matlabgirltag:de.mathworks.com,2005:Question/2861912016-05-28T11:40:31Z2016-05-28T11:57:33ZVectorization of a nested for loop, where inner counter depends on outer one.<p>Hi, I'm trying to vectorize the following code:</p><pre> for i=3:6
for j=i:6
howmuch = howmuch + factorial(j) / factorial(j - i);
end
end</pre><p>I tried the meshgrid approach, however couldn't find a way to connect "j to i". How can I do this?</p><p>Thanks!</p>Bidsitlovhttp://de.mathworks.com/matlabcentral/profile/authors/8224553-bidsitlovtag:de.mathworks.com,2005:Question/2861922016-05-28T11:55:46Z2016-05-28T11:59:14ZWhat callback parameters of Constant block in simulink to be changed to get the ascii of keypressed as output else zero during simulation ?<p>I wanted to have the control of triggering events while acquiring data from hardware, with key press. Thus was searching for it. Found an answer where in a way was described to get a block to ask for input on the command line at <a href = "http://in.mathworks.com/matlabcentral/answers/9753-create-a-block-to-read-keyboard-inputs">here</a>, but it always aks at command prompt for the key, doesn't monitor keypresses asynchronously. Also in MATLAB's inbuilt game "eml_asteroids", the interface... left right arrows, space bar for shooting are described as constant blocks. Tried to find, how did they convert it into the callback blocks monitoring keypress events by checking any commands in "callbacks" tab in its properties.. found nothing. Searched quite a lot. At last didn't understand. Please help me in understanding and getting my work of having (or) making a "block with keypress events and two outputs, first being a boolean specifying whether a key is pressed, second the ascii of key pressed. It would be of great help.... to have my doubt cleared. Thank you...</p>Wupadrasta Santoshhttp://de.mathworks.com/matlabcentral/profile/authors/5048977-wupadrasta-santosh