https://es.mathworks.com/matlabcentral/answers/questions.atomMATLAB Answers — New Questions2017-04-28T12:09:01Ztag:es.mathworks.com,2005:Question/3378092017-04-28T12:08:26Z2017-04-28T12:08:26Zhow to match complete row in cell array and then find index<p>i have a cell array like this</p><img src = "/matlabcentral/answers/uploaded_files/76410/cell%20array.PNG"><p>and then i want to compare a row like</p><img src = "/matlabcentral/answers/uploaded_files/76411/Capture1.PNG"><p>which is row no 4 in cell array. so after comparision the result should be index of cell araay corresponding to that row i.e. 4.</p><p>so what should i do about this plz help.</p><p>thank u.</p>khushboo Sharmahttps://es.mathworks.com/matlabcentral/profile/authors/9247263-khushboo-sharmatag:es.mathworks.com,2005:Question/3377932017-04-28T10:28:27Z2017-04-28T12:09:01ZHow can I extract columns from a matrix faster?<p>My algorithm repeats the action of extracting columns from a large matrix many times and it's taking a lot of run-time.</p><p>The code line (that repeats many times and is very costly) is simply:</p><pre class="language-matlab">relevant_columns = M(:,relevant_columns_indexes);
</pre><p>Where <i>M</i> is a 4096 X 50000 matrix and <i>relevant_columns_indexes</i> is a 1 X 50000 logical vector.</p><p>(The number of non-zeros elements that corresponds to the relevant columns is a different number every time but with the average of about 60. So, in average I'm extracting about 60 columns out of 50K each time).</p><p><b>What can I do to make it faster?</b></p><p>I tried to use short indexes vector instead of a long logical vector, to work on rows instead of columns, etc. But still didn't find something that worked faster... (Should I try to convert to C code and run with mex?)</p><p>Thanks.</p><p><b>Some more details:</b></p><p>The matrix M is already loaded in my workspace.</p><p>The action I actually need to do is summation:</p><pre class="language-matlab">final_results = sum(relevant_columns,2);
</pre><p>or, equivalently:</p><pre class="language-matlab">final_results = sum(M(:,relevant_columns_indexes),2);
</pre><p>But the heavy part (to the best of my understanding) is the extraction.</p><p>A screenshot from the profile is attached.</p>Noam Yairhttps://es.mathworks.com/matlabcentral/profile/authors/10196769-noam-yairtag:es.mathworks.com,2005:Question/3378082017-04-28T12:07:44Z2017-04-28T12:07:44ZEasy question but I don't know the solution.<p>Hi folks</p><p>Sorry for this easy question, but I really can't find it.
I have an EditField in my app designer app.
the text in there needs to be saved under DataName as an .mat file.
So if there is 'Barcelona' in the EditField, DataName must be 'Barcelona.mat'. How can I do this?</p><p>Thanks already!</p>Daan Decleerhttps://es.mathworks.com/matlabcentral/profile/authors/8852120-daan-decleertag:es.mathworks.com,2005:Question/3377342017-04-28T01:07:44Z2017-04-28T12:05:45ZClass Property: Array of Objects<p>I would like to create a "Dependent Property" inside a "Main Class" that will handle a array of objects of "Sub Class".</p><p>Exemple:</p><pre class="language-matlab">classdef main_class
properties
number
end
properties (Dependent)
% prop will be a array of sub_class object
% the size of this array will depend/change on the "number" property
prop = sub_class();
end
end
</pre><p>If I set:</p><pre class="language-matlab">main = main_class();
main.number = 3;
</pre><p>I would like to get:</p><pre class="language-matlab">main.prop = [sub_class(1) sub_class(2) sub_class(3)]
</pre><p>To me is important that "prop" be a dependent property to automatic change the number of the elements in the array.</p><p>How could I do that?
Thanks!</p>Nycholas Maiahttps://es.mathworks.com/matlabcentral/profile/authors/8458420-nycholas-maiatag:es.mathworks.com,2005:Question/3378072017-04-28T11:58:57Z2017-04-28T11:58:57Zhow to access a workspace call array in appdesigner and get the transpose of that<p>how to load a workspace call array in appdesigner and get the transpose of that. i have a push button in my app.in my push button call back function i should access workspace cell array and get the transpose of it. Kindly help me how to solve it.</p>pavan sunderhttps://es.mathworks.com/matlabcentral/profile/authors/6089829-pavan-sundertag:es.mathworks.com,2005:Question/3378062017-04-28T11:58:40Z2017-04-28T12:00:21ZPlotting anonymous functions with fsurf - involving cell arrays.<p>I have a long equation of around 100 terms which I want to plot using fsurf.</p><p>To avoid typing in the equation by hand I’ve constructed it using a for-loop to make a cell array called “Equation1”. See the simplified version below, where “Coefficients” are just numerical values determined previously:</p><pre class="language-matlab">for Ci=1:2
for Cj=1:50
n2=n2+1;
Equation1{n2}=@(r,s)Coefficients(n2)*cos(Ci*r*pi/180)*cos(Cj*s*pi/180);
end
end
</pre><p>I can then construct this into a plottable equation by typing out the following:</p><pre class="language-matlab">Equation2=@(x,y)Equation1{1}(x,y)+Equation1{2}(x,y)+...+Equation1{100}(x,y)
</pre><p>And plotting it:</p><pre class="language-matlab">fsurf(Equation2,[0 360])
</pre><p>Is there a more efficient way to construct Equation2? Or even better, a way to plot straight from Equation1?</p><p>Thank you in advance for any help/advice.</p>C Dicksonhttps://es.mathworks.com/matlabcentral/profile/authors/8397604-c-dicksontag:es.mathworks.com,2005:Question/3378052017-04-28T11:55:10Z2017-04-28T11:56:05ZHow to do double strings match in single statement<p>Hi,
I have below cell array matrix and I want check two strings matchig in single statement:</p><p>condition: If row element in column1 is Normal & column2 value>=20, then copy to normalData, else copy to abnormalData
InputData:</p><pre class="language-matlab">Re/Attempt 12
Normal 24
Normal 13
Re/Attempt 26
Re/Attempt 28
Normal 23
Normal 12
Normal 15
</pre><p>normalData:</p><pre class="language-matlab">Normal 24
Normal 23
</pre><p>abnormalData:</p><pre class="language-matlab">Re/Attempt 12
Normal 13
Re/Attempt 26
Re/Attempt 28
Normal 12
Normal 15
</pre><p>Many thanks in advance,</p>Kanakaiah Jakkulahttps://es.mathworks.com/matlabcentral/profile/authors/6734702-kanakaiah-jakkulatag:es.mathworks.com,2005:Question/1228472014-03-24T12:55:17Z2017-04-28T11:54:16ZWhy do I get so many phase jumps in the FRF of an impact hammer test?<p>Hello to the community!</p><p>I am performing an experimental modal analysis and the following problem occured: I use NI Labview to get my measurement signals from an impact hammer and our laser vibrometer; so for those well familiar with modal analysis - its a mobility Frequency Response Function (FRF = Velocity/Force).</p><p>Afer loading the data into Matlab I am doing software triggering and use just the spike of the hammer impact; afterwards I am performing a Fast Fourier Transform of the truncated and windowed hammer and vibrometer signals and I calculate the FRF by dividing the two transformed signals.</p><p>Now my problem arises: If I plot the phase of the FRF I get a highly oscillating phase plot - the phase is rapidly jumping between +180° and -180°, and this over a wide frequency range:</p><img src = "/matlabcentral/answers/uploaded_files/10305/Bild1.jpg"><p>If I use unwrap(...) I get the following result, which does not really look better either:</p><img src = "/matlabcentral/answers/uploaded_files/10306/Bild2.jpg"><p>So has anyone an idea? Both signals look quite sensible when plotted over time; but I really have no idea right now what causes these jumps in the phase of the FRF.</p><p>Maybe someone can help?
Thanks!</p>Lukashttps://es.mathworks.com/matlabcentral/profile/authors/3224132-lukastag:es.mathworks.com,2005:Question/3378042017-04-28T11:52:13Z2017-04-28T11:52:13Zhow can I change the constate value in the level2 sfunction through the setsimstate api<p>the demo in matlab show a way to change the values in Pwork through 'setsimstate',but for the constates,i can't change the values.everytime after i set a new value, it will return to the value before i set it when it comes to a new timestep.</p>yaxing zhouhttps://es.mathworks.com/matlabcentral/profile/authors/10235377-yaxing-zhoutag:es.mathworks.com,2005:Question/3377792017-04-28T08:35:13Z2017-04-28T11:51:06Zsuperimpose extremas of region on image<p>hello everyone
im a beginner in matlab.
could anybody help me please:
i have found the extremas of a region wich comes frome extrema property of 'regionprops'command.
this 'extrema' matrix is a 8-by-2 matrix. now, i want to show this 8 points on my original image.
could anybody help me how can i do this?</p><p>s=regionprops(im6,'all');
Extremas=cat(1,s.Extrema);</p>talahttps://es.mathworks.com/matlabcentral/profile/authors/8858317-talatag:es.mathworks.com,2005:Question/1651162014-12-02T15:07:19Z2017-04-28T11:49:39ZConstructing an Offset-Curve<p>Probably this question has already been posted several times, however I was not able to find an answer.</p><p>I have a smooth curve given as a set of X and Y data points and I am trying to constrcut an offset curve. Bascially my strategie was to search for the perpendicular direction at each point of the given [X,Y] data set and then follow this direction according to the desired offset. This works well for convex curves. However for concave curves, there will be a setback at certain points.</p><p>This is actually a very common problem in CNC programming. Commercial CAD and CAM software packages mostly offer a solution to this problem.
Unfortunately I was not able to find a solution in matlab. Maybe I am looking in the wrong place...</p><p>I would be glad if someone could share their knowledge.</p><p>Thanks in advance!
Ben</p>Benhttps://es.mathworks.com/matlabcentral/profile/authors/3180864-bentag:es.mathworks.com,2005:Question/3377692017-04-28T07:43:28Z2017-04-28T11:39:00ZCan I copy an installed matlab toolbox from one device to another ? <p>Hi
I have installed several toolboxes on one of my devices,now I need them on my other device
Is it possible to copy them or I should download them again?
If yes,how?</p>hamoon shhttps://es.mathworks.com/matlabcentral/profile/authors/10204446-hamoon-shtag:es.mathworks.com,2005:Question/3378032017-04-28T11:33:32Z2017-04-28T11:58:33ZClarification on Matlab function "Interpft".<p>Hello there,</p><p>My problem is quite simple. I've been trying to up-sample a time domain signal by exploiting the FFT operator. What I did is quite simple:</p><ol><li>FFT to map the signal from Time Domain to Frequency Domain;</li><li>FFTSHIFT to center wrt the 0-Frequency bin;</li><li>Padding both sides with an equal amount of zeros;</li><li>IFFTSHIFT;</li><li>IFFT.</li></ol><p>The results that I got from the aforementioned algorithm were then compared with the ones carried out by the "INTERPFT" operator. What I found out is that the results are equal when the size of the input sequence is odd. Vice-versa, when the size is even, the results differ.</p><p>Then, I checked the "INTERPFT" code in order to understand my mistake. As far as I understood, I put the zeros in the wrong place and I did not take care of the sample at (- Sampling Frq.)/2.</p><p>See below the chunk of the code from "INTERPFT":</p><pre class="language-matlab">a = fft(x,[],1);
nyqst = ceil((m+1)/2);
b = [a(1:nyqst,:) ; zeros(ny-m,n) ; a(nyqst+1:m,:)];
if rem(m,2) == 0
b(nyqst,:) = b(nyqst,:)/2;
b(nyqst+ny-m,:) = b(nyqst,:);
end
</pre><p>Can anybody clarify on these steps? Why is it needed to split the energy related to the Frequency bin at (- Sampling Frq.)/2?</p><p>Thanks for your time,</p><p>Emiliano</p>Emiliano Casalinihttps://es.mathworks.com/matlabcentral/profile/authors/6868002-emiliano-casalinitag:es.mathworks.com,2005:Question/3378002017-04-28T11:06:58Z2017-04-28T11:32:26ZWhere can I get precise description about usage of manova1 function above matlab documentation? <p>Hello!</p><p>I have serious problems in setting up manova1 for my statistical issue and can't find any further descriptions with valid examples above matlab documentations. (grouping variables: 2 with 5 and 6 values respectively; 1 independent variable).
I'd very delighted for corresponding recommendations about literature, Websites and so on as well as any kind of advice.</p><p>Thank you and best regards
Eva</p>Eva-Maria Weisshttps://es.mathworks.com/matlabcentral/profile/authors/6680200-eva-maria-weisstag:es.mathworks.com,2005:Question/3378022017-04-28T11:32:06Z2017-04-28T11:37:23ZHow to upload image using push button?<p>Below is the code I'm using and it works for browse the folder.But the image didn't come out.</p><p>% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)</p><p>% 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)
[FileName,PathName]=uigetfile({'*.bmp,*.jpg'},'Select a image file');
axes(handles.axes1);
imshow([Path_Name,File_Name]);</p><p>Here is the error when I run the code:</p><p>Undefined function or variable 'Path_Name'.</p><p>Error in iris1>pushbutton1_Callback (line 83)
imshow([Path_Name,File_Name]);</p><p>Error in gui_mainfcn (line 96)
feval(varargin{:});</p><p>Error in iris1 (line 42)
gui_mainfcn(gui_State, varargin{:});</p><p>Error in@(hObject,eventdata)iris1('pushbutton1_Callback',hObject,eventdata,guidata(hObject))</p><p>Error while evaluating uicontrol Callback</p><p>Does anyone can suggest me a solution?
Thank you.</p>Baitihttps://es.mathworks.com/matlabcentral/profile/authors/5877547-baititag:es.mathworks.com,2005:Question/3376972017-04-27T19:01:29Z2017-04-28T11:29:27ZWhat is the best way to vectorize this matrix problem?<p>I have a square matrix A which I would like to manipulate using a "map" matrix D. The result will be the matrix B. The entry B(i, j) will be a sum of a number of elements from A(:, j), as determined by D. In the following example, the matrix D tells me that A(1, 1) will be added with A(3, 1) to form B(1, 1), and so on. When the matrices are large, this process takes a long time. Is there a way to vectorize this computation?</p><pre class="language-matlab">A = magic(3); % initial matrix
D = [1, 2, 3; 2, 2, 3; 1, 3, 1]; % map matrix
B = zeros(3); % resultant matrix
for i = 1:3
for j = 1:3
B(D(i, j), j) = B(D(i, j), j) + A(i, j);
end
end
</pre>John Malikhttps://es.mathworks.com/matlabcentral/profile/authors/9179749-john-maliktag:es.mathworks.com,2005:Question/3377902017-04-28T10:16:35Z2017-04-28T11:28:40ZHow to evaluate optical circle which are filled?<p>I am working on OMR(optical mark recognition) evaluation system where i am getting subjective area(ROI) after scanned image processing. As bubble matrix is 10*10, length of the roll number is some fix constant, how can i make logic to evaluate filled circle? How can i differentiate circle and other object inside image?</p><img src = "/matlabcentral/answers/uploaded_files/76396/roi15.jpg">Sabanamhttps://es.mathworks.com/matlabcentral/profile/authors/4834026-sabanamtag:es.mathworks.com,2005:Question/3377632017-04-28T06:52:51Z2017-04-28T11:28:25ZHow to determine the volume bounded by z=x^(a-1)*y^(b-1)*exp(-x^a-y^b) and z=0.05 (a,b>1) x>=0 y>=0<p>I have difficulty computing the volume of the above problem. As the function is implicit, I am unable to write the boundaries in terms of function.</p><p>I have used integral2, integral3, dblquad and other functions but they obviously do not give correct answers
as limits must be functions.</p><p>The volume may be numerically computed. Is there a script that lets you enter these equations and computes the volume itself? If not, how do I calculate it?</p>Muhammad Hamza Sattahttps://es.mathworks.com/matlabcentral/profile/authors/10234141-muhammad-hamza-sattatag:es.mathworks.com,2005:Question/3378012017-04-28T11:27:18Z2017-04-28T11:27:18ZHow to calculate the daily average from a txt file?<p>I've got a txt file containing one year wind speed data every 10 min. I'd like to calculate the daily average, however, the wind speed data is uneven and includes NaN.</p><p>The txt file has headlines such as YY MM DD etc and the wind speed is under headline WSPD.</p>jimhttps://es.mathworks.com/matlabcentral/profile/authors/2552975-jimtag:es.mathworks.com,2005:Question/3376832017-04-27T17:19:25Z2017-04-28T11:26:56ZHow to get the mean value of the area around certain coordinates of an image?<p>Hi,
I am writing a code to analize all the frames of a video. I have already split the video on its frames.
To simplify my question lets take a single grey scale image.</p><p>I have an image.
I have a mesh of points (with their coordinates). The mesh is a regular square mesh.
I would like to get the average value in the area around each of these points.
And if it is posible to have these mean values in a matrix.</p><p>How do you recomend me to do it?</p><p>Thank you in advance.</p>ferran parerahttps://es.mathworks.com/matlabcentral/profile/authors/8301132-ferran-pareratag:es.mathworks.com,2005:Question/3377872017-04-28T09:40:26Z2017-04-28T11:25:02ZHow can I crop the human's uppperbody from an image automatically?<p>the picture contains fullbody of human, and I use Viola-jones algorithm to detect the upper body. and I want to crop that upperbody.
thanks before :)</p>deanda haniyahhttps://es.mathworks.com/matlabcentral/profile/authors/8878064-deanda-haniyahtag:es.mathworks.com,2005:Question/355722012-04-16T04:54:34Z2017-04-28T11:24:36ZMaking two images of equal dimensions in MATLAB<p>i am trying to apply SURF algorithm, <a href="http://www.mathworks.com/matlabcentral/fileexchange/28300">http://www.mathworks.com/matlabcentral/fileexchange/28300</a>
which is the algo to find the key points and matches corresponding two images, but the problem is that in my case , i want to apply that algo with two images, but they are of different dimension and so it fails to work, could you please tell what shall i do so that both images become equal dimensions.</p>KThttps://es.mathworks.com/matlabcentral/profile/authors/3434830-kttag:es.mathworks.com,2005:Question/3377522017-04-28T04:13:43Z2017-04-28T11:21:32ZHow can i vectorize the for loop in this code? is there any solution to calculate a matrix having both the variable indice? <pre class="language-matlab">clear all; % clear all variables in memory
close all;
</pre><pre class="language-matlab">xl = 0;
xr = 1;
T =0.1;
</pre><pre class="language-matlab">Nt = 5000; % Number of time steps
dt = T/Nt;
xn = 50; % Number of space steps
dx = (xr-xl)/xn;
mu = dt/(dx)^2; % Stability parameter (mu=<1)
%%
if mu > 0.5 % make sure dt satisy stability condition
error('mu should < 0.5!')
end
%%
tic;
</pre><pre class="language-matlab">% i = 1:xn+1
x(2:xn+1) =(0:xn-1)*dx;
u(2:xn+1,1) =sin(pi*x(2:xn+1)) + sin(2*pi*x(2:xn+1));
%%
</pre><pre> j=2:Nt+1;
tm(j)= (j-1)*dt;
t = tm(j);
u(1,j) = sin(pi*xl)*exp(-pi*pi*t)+sin(2*pi*xl)*exp(-4*pi*pi*t);
u(xn+1,j) = sin(pi*xr)*exp(-pi*pi*t)+sin(2*pi*xr)*exp(-4*pi*pi*t);
%%</pre><pre class="language-matlab">for j=2:Nt+1 % Time Loop
% i=2:xn; % Space Loop
u(2:xn,j)=u(2:xn,j-1)+mu*(u(3:xn+1,j-1)-2*u(2:xn,j-1)+u(1:xn-1,j-1));
% end
end
</pre><pre class="language-matlab">xj = xl + (gpuArray(0:xn).*dx);
B= (sin(pi*xj))';
B_2D = repmat(B,1,Nt+1);
C= exp(-pi*pi*gpuArray(1:Nt+1)*dt);
C_2D = repmat(C,xn+1,1);
u_ex_a = B_2D.*C_2D;
D= (sin(2*pi*xj))';
D_2D = repmat(D,1,Nt+1);
E= exp(-4*pi*pi*gpuArray(1:Nt+1)*dt);
E_2D = repmat(E,xn+1,1);
u_ex_b = D_2D.*E_2D;
u_ex=u_ex_a+u_ex_b;
</pre><pre class="language-matlab">er = u_ex - u;
D = abs(u-u_ex).^2;
MSE = sum(D(:))/numel(u);
</pre>Priya Khothttps://es.mathworks.com/matlabcentral/profile/authors/9415355-priya-khottag:es.mathworks.com,2005:Question/3373862017-04-26T10:34:57Z2017-04-28T11:12:28ZHow can I use a filter in a parfor with the more numerically stable z,p,k?<p>Hello,</p><p>I would like to use a filter in a parfor loop. Using [b,a] coefficients there is no problem. Because of a better stability I have to use the [z,p,k] coefficients. It perfectly works in a for loop. However, in a parfor loop the error massage "Not enough input arguments." appears. Does anyone know a workaround?</p><p>Here is a little example: Anything works but the last loop!</p><pre class="language-matlab">% Signal
x = sin(0:pi/1000:10*pi);
</pre><pre class="language-matlab">% Filter properties
N = 1;
fc = 1/(2*pi);
fs = 1000/pi;
Wn = fc/(fs/2);
ftype = 'low';
</pre><pre class="language-matlab">% Transfer Function design
[b,a] = butter(N,Wn,ftype);
</pre><pre class="language-matlab">% Zero-Pole-Gain design
[z,p,k] = butter(N,Wn,ftype);
[sos,g] = zp2sos(z,p,k);
hd = dfilt.df2tsos(sos, g);
</pre><pre class="language-matlab">%% Loops
</pre><pre class="language-matlab">for n=1:2
y = filter(b,a,x);
end
</pre><pre class="language-matlab">parfor n=1:2
y = filter(b,a,x);
end
</pre><pre class="language-matlab">for n=1:2
y = filter(hd, x);
end
</pre><pre class="language-matlab">parfor n=1:2
y = filter(hd, x);
end
</pre>Gordonhttps://es.mathworks.com/matlabcentral/profile/authors/6027240-gordontag:es.mathworks.com,2005:Question/3332582017-04-02T20:32:58Z2017-04-28T11:08:41ZHow to display the contour line values from a contour plot generated using the curve fitting tools?<p>I created this 2D contour plot using sfit from the curve fitting tools app, and I am trying to have the values of each contour line displayed in the contour plot. I've gone through some other examples, but they only use the contour function, and not data generated from the sfit. Here is the generic code extracted from the CFtools:</p><pre class="language-matlab">%CREATEFIT(SCANTIME,DRUMHEIGHT,CORRECTEDDENSITY)
% Create a fit.
%
% Data for 'untitled fit 1' fit:
% X Input : Time
% Y Input : Location
% Z Output: Speed
% Output:
% fitresult : a fit object representing the fit.
% gof : structure with goodness-of fit info.
%
% See also FIT, CFIT, SFIT.
</pre><pre class="language-matlab">% Auto-generated by MATLAB on 29-Mar-2017 23:17:04
</pre><pre class="language-matlab">%% Fit: 'untitled fit 1'.
[xData, yData, zData] = prepareSurfaceData( Time, Location, Speed );
</pre><pre class="language-matlab">% Set up fittype and options.
ft = fittype( 'loess' );
opts = fitoptions( 'Method', 'LowessFit' );
opts.Normalize = 'on';
opts.Span = 0.05;
</pre><pre class="language-matlab">% Fit model to data.
[fitresult, gof] = fit( [xData, yData], zData, ft, opts );
</pre><pre class="language-matlab">% Make contour plot.
figure( 'Name', 'Loess Quadratic' );
h = plot( fitresult, [xData, yData], zData, 'Style', 'Contour');
set(h(2),'MarkerSize',0.0001);
legend(h, 'Loess Quadratic', 'Speed vs. Time, Location', 'Location', 'NorthEast' );
% Label axes
xlabel Time(min)
ylabel Location(in)
grid on
h = colorbar
</pre><p>Thank you in advance for the help.</p>Pedro Amorimhttps://es.mathworks.com/matlabcentral/profile/authors/10071128-pedro-amorimtag:es.mathworks.com,2005:Question/1686952015-01-02T09:13:53Z2017-04-28T11:06:21ZConvert simulink model to a single transfer function<p>Hi,</p><p>Given my diagram below, how do i convert it into a single block with the equivalent transfer function ? I do not mind having the transfer function displayed on MATLAB's command window instead.</p><img src = "/matlabcentral/answers/uploaded_files/23287/TF.png"><p>https://www.youtube.com/watch?v=MG4LqZLsrC0 does not work as i have undefined constants in my diagram. I would like to be able to convert it to a single transfer function for studies. I know it is easy to solve it on paper to convert it to a single TF but I am learning MATLAB and I would like to overcome this problem. Thanks.</p><p>Regards,
Haziq</p>RuiQihttps://es.mathworks.com/matlabcentral/profile/authors/6016970-ruiqitag:es.mathworks.com,2005:Question/1225732014-03-21T13:46:41Z2017-04-28T11:06:07ZMATLAB Mobile connector time out<p>I tried to connect my MATLAB Mobile (at galaxy s3) to my PC.
The connector test at my PC works good, but whenever I try to connect to my PC from MATLAB Mobile, it does not succeed and shows "time out" message. How can I fix this problem?</p>Kwanghyunhttps://es.mathworks.com/matlabcentral/profile/authors/4106711-kwanghyuntag:es.mathworks.com,2005:Question/3377992017-04-28T11:04:11Z2017-04-28T11:22:10ZAudio Feaure Extraction Matrix<p>Hi guys! I am currently working on drum transcription through the query of beatbox. It requires audio feature extraction and the respective classification training and testing. I am currently having problems computing just one extracted feature, MFCC, eve more when trying to put others into a matrix, like Zero Crossing Rate and Spectral Centroid/Temporal Centroid. My idea is to grab a percussive audio signal (kick), split it into 5 successive frames of an equal interval of that same signal.</p><p>Grab Frame 1 until Frame 5 and extract features for each of those frames (MFCC, Spectral Centroid,etc). If we were to put it practically, 5 frames (per signal), times 5 features equals to 25 values.</p><p>Next step would be to take a mean of the respective frames' features. Input all the kicks into a matrix (319x5) for all the 319 events of kicks, times the 5 features. Repeat for all the other supervised labelled classes.</p><p>After I want to introduce them in a Support Vector Machine, train the data and test it against the Test database of pre-recorded drum hits.</p><p>Here is what I am attempting:</p><pre class="language-matlab">mfcc_size = 13;
TRAINING = [];
Y = 0;
n=0;
% repeat from here....
% change directory
wavfiles = dir('*.wav')
%copy this...?
for file = wavfiles'
n=n+1;
fprintf(1,'Processing %s\n',file.name)
a = file.name
f = mirframe(a);hold off
s = mirspectrum(f,'Frame','Window','hanning','Mel');hold off
m = mirspectrum(s,'Mel');hold off
c = mirmfcc(m,'Rank',1:13);
temp = mirgetdata(c);
set(gcf, 'name',file.name); colorbar
TRAINING(:,n) = temp(2:13);
Y = [Y 1]; %where this is the class label for just one instrument (kick)
% eval(['print -djpeg SpectrviewMFCC_' num2str(file.name) '.jpeg']);
end
% to here...?
</pre><p><i>_____</i></p><p>To train, extract MFCCs from training data = TRAINING /
Create labelled data of Y(class labels = Y /</p><p>svsmstruct = svmtrain(TRAINING, Y) /
extract MFCCs from testing data = Test/
RESULTS = svmclassify (svmstruct,TEST)/</p><p>Any thoughts and directions on structure, syntax, solutions for inputting data and extracting features followed by tips for training/classifying within MatLab?</p><p>P.S I am currently using MIRToolbox, to do all the processing. I tried to implement Weka with Matlab, but no avail, as I am still not able to compute my audio feature matrix and output data to train.</p><p>Best regards, I hope to hear from you all, which have been a very supportive community so far!
Antonio</p>Antonio Macedohttps://es.mathworks.com/matlabcentral/profile/authors/7865106-antonio-macedotag:es.mathworks.com,2005:Question/3376882017-04-27T17:56:57Z2017-04-28T11:03:23ZMATLAB R2017a + Arduino + macOS Sierra<p>I run an Arduino sketch which establish the serial communication with Arduino in this way:</p><pre class="language-matlab">void setup() {
Serial.begin(115200);
Wire.begin();
Serial.println("Hello!!");....}
</pre><p>Now I want to run a matlab .m file like this:</p><pre class="language-matlab">port='/dev/cu.usbserial-AI02PH8A'; %the same port seen in Arduino environment
packetSize=24;
Arduino = serial(port,'BaudRate',115200,'InputBufferSize',packetSize);
fopen(Arduino);
fwrite(Arduino,'r');%in the Arduino sketch the command 'r' starts some operations
lastData = fread(Arduino,24);
</pre><p>The problem is that everytime I run the Matlab file it stops giving me the error that the port I choice doesn't exist.</p><p>If I type <i>instrfind</i> in the command window there are 2 open ports: the one I choose and another one named '/dev/tty.usbserial-AI02PH8A'.
Trying to substitute my port '/dev/cu.usbserial-AI02PH8A' with '/dev/tty.usbserial-AI02PH8A', I receive the same error back.</p><p>I guess it's a problem dealing with macOS Sierra.</p><p>Anyone can provide me a solution different from removing the cable before running the Matlab file?</p>tempsterhttps://es.mathworks.com/matlabcentral/profile/authors/9602575-tempstertag:es.mathworks.com,2005:Question/3375542017-04-27T05:19:48Z2017-04-28T11:01:03Zi want gaussian pyramid generation and laplacian pyramid transform matlab code<p>N layer laplacian pyramid transform matlab code is need.The Contrast limited adaptive histogram equalization is applied on N layer of laplacian pyramid . reconstruct laplacian pyramid.</p>Aarsha mvhttps://es.mathworks.com/matlabcentral/profile/authors/9925343-aarsha-mvtag:es.mathworks.com,2005:Question/3377682017-04-28T07:35:14Z2017-04-28T10:56:40Zhow to find h[n] from the following discrete equation <p>hello, i want to solve and find h[n] from the following equation with matlab :
x[n]=-0.3δ[n+2]+2δ[n]+1.5δ[n-3]-δ[n-5]
please help</p>rivaldo rivaldohttps://es.mathworks.com/matlabcentral/profile/authors/9307181-rivaldo-rivaldotag:es.mathworks.com,2005:Question/3377982017-04-28T10:55:15Z2017-04-28T10:55:15Zhow make echo hiding ?<p>Hello everybody;
I want to apply the audio watermarking, that's why I thought of implementing a sequence '' zero '' or '' one '', the selection of the sequence to implement is dependent on a binary sequence, I have Opted has this code but there is always a small concern when I apply the convolution product, if someone can help me, I will be very grateful, Thanks in advance</p><img src = "/matlabcentral/answers/uploaded_files/76401/prog.png">meziane madanihttps://es.mathworks.com/matlabcentral/profile/authors/6411549-meziane-madanitag:es.mathworks.com,2005:Question/3377842017-04-28T09:04:29Z2017-04-28T10:54:31Zaddpath not working - fopen problem?<p>when adding a path through the simple command:</p><p>>> addpath(genpath('D:\Documents\MATLAB'))</p><p>the response is:</p><p>Warning: Function fopen has the same name as a MATLAB builtin. We suggest you
rename the function to avoid a potential name conflict.</p><p>In path (line 109)</p><p>In addpath (line 88)</p><p>Warning: Function input has the same name as a MATLAB builtin. We suggest you
rename the function to avoid a potential name conflict.</p>Luisa Nicolettihttps://es.mathworks.com/matlabcentral/profile/authors/1286714-luisa-nicolettitag:es.mathworks.com,2005:Question/3376062017-04-27T10:42:29Z2017-04-28T10:54:28ZCan't set breakpoints on changed m-file<p>I run a numerical simulation called "myfile.m". Then I accidentally changed the code of "myfile.m", by accidentally inserting a character somewhere. The file now has an asterisk "myfile.m*". By itself not a big issue, but now I can't debug anymore :( Setting breakpoints gives a gray bullet instead of a red one. And it says "Save file to synchronize breakpoints". When I press "save", it says "Cannot save myfile.m while it is being debugged. Exit debug mode and save?" .... I am kinda scared to do this, because I remember having pressed this before and the whole simulation stopped, not just the debugging. And I don't know what is meant by "Exit debug". I am not debugging anyway. The simulation has been running for 24 hours, and the last time the red bulletpoints worked it showed some very good intermediate results, so I really don't want to waste them. But it will go on for another 24 hours, and I don't have the time, so I want to save the intermediate results stored in the variables, which I can only access using the breakpoints, right?</p>Marloeyshttps://es.mathworks.com/matlabcentral/profile/authors/10229203-marloeystag:es.mathworks.com,2005:Question/3377962017-04-28T10:48:01Z2017-04-28T10:54:02ZHow can i change the years with the dates in a data set?<p>Hi guys,
I have two data sets containing dates. The data sets are from different sources.
I would like to compare the data sets with each other and to be able to do that i should have the same date/month/year.
Unfortunately, somehow the one data set (B below) changes the dates with the years.
Here is an example from both data sets:</p><p>Data set:
A</p><pre> 03-01-2008 09:00:00
03-01-2008 10:00:00
03-01-2008 11:00:00
03-01-2008 12:00:00
03-01-2008 13:00:00
03-01-2008 14:00:00
03-01-2008 15:00:00
03-01-2008 16:00:00
03-01-2008 17:00:00
03-01-2008 18:00:00
03-01-2008 19:00:00
03-01-2008 20:00:00
03-01-2008 21:00:00
03-01-2008 22:00:00
03-01-2008 23:00:00
04-01-2008 00:00:00
04-01-2008 01:00:00
04-01-2008 02:00:00
04-01-2008 03:00:00</pre><p>and</p><pre> B
08-01-0003 09:00:00
08-01-0003 10:00:00
08-01-0003 11:00:00
08-01-0003 12:00:00
08-01-0003 13:00:00
08-01-0003 14:00:00
08-01-0003 15:00:00
08-01-0003 16:00:00
08-01-0003 17:00:00
08-01-0003 18:00:00
08-01-0003 19:00:00
08-01-0003 20:00:00
08-01-0003 21:00:00
08-01-0003 22:00:00
08-01-0003 23:00:00
08-01-0004 00:00:00
08-01-0004 01:00:00
08-01-0004 02:00:00
08-01-0004 03:00:00</pre><p>Obviously, it can be seen from data set B that the year should be 2008 and the day 03 or 04.
Do you know how i fix this problem?
Thank you in advance
Andreas</p>Andreas Andreouhttps://es.mathworks.com/matlabcentral/profile/authors/6858991-andreas-andreoutag:es.mathworks.com,2005:Question/3377972017-04-28T10:48:38Z2017-04-28T10:50:33ZJava heap size is not accessing all available RAM<p>Hi,</p><p>I am currently running 64-bit Matlab (making use of 64-bit Java) on a server with 128GB of RAM.</p><p>In my Matlab preferences, I cannot increase the Java heap size beyond 32GB - this is causing my code to fail (it is unable to read ~70 million rows of data from SQL).</p><p>This has worked in the past, and the java heap size setting gave me the option to slide across to 128GB, but as I said it is now only letting me increase to 32GB.</p><p>I am not in a position to change the code - this was written by someone else, and I do not have the sign off to change this at the moment.</p><p>Any help will be appreciated.</p><p>Thanks,</p>Atifahhttps://es.mathworks.com/matlabcentral/profile/authors/4867000-atifahtag:es.mathworks.com,2005:Question/3312462017-03-22T10:30:54Z2017-04-28T10:43:28ZError evaluation on convolutional net<p>I have trained a conv net, using imds function as datastore and trainNetwork for the training. I would like to plot something similar to the matlab function "plotperform", but I cannot get that function working, since it requires another type of input, which the trainNetwork does not output.
I need to know, how to plot the validation error together with the training error.</p>Simonhttps://es.mathworks.com/matlabcentral/profile/authors/4044652-simontag:es.mathworks.com,2005:Question/3377942017-04-28T10:37:00Z2017-04-28T10:37:00ZUsing latin hypercube sampling<p>I'm new to matlab and need some help with latin hypercube sampling. I want to know the relation of variables a(-10--0.5),b(700-1100),c(5-50),d(1.013-1.083) to variable y. To simplify, I want to know how y changes when the variables change. I have a simulation where i can take any needed samples.</p>pkuus23https://es.mathworks.com/matlabcentral/profile/authors/10235115-pkuus23tag:es.mathworks.com,2005:Question/3377922017-04-28T10:27:49Z2017-04-28T10:27:49Z what is the Global Optimization Toolbox containing this file @cantileverConstraintsWithDisc ? <p>Please, can you tell me what is the Global Optimization Toolbox containing this file @cantileverConstraintsWithDisc ?
Thank you</p>houda mejrihttps://es.mathworks.com/matlabcentral/profile/authors/9669688-houda-mejritag:es.mathworks.com,2005:Question/3377832017-04-28T08:53:29Z2017-04-28T10:26:51ZHow to call a class function from a for loop which the results stay in the original class<p>Hi All,</p><p>I have made a class to hold and process experiment data. I have a different object for each test as follows:-</p><pre> test1 = experimentClass;
test2 = experimentClass;</pre><p>I'd like to process the test data for a group of tests all at once. To do this I created a variable: -</p><pre> dataset = [test1; test2]</pre><p>Then call the method in a for loop: -</p><pre> for ii = 1:length(dataset)
dataset(ii).processTest;
end</pre><p>The problem is the result is not stored as a in the original class object. even though it works correctly when the called directly (ie test1.processTest). I also can't find a way to get the original object name (ie test1...) to add to graph titles.</p><p>Could you suggest the correct way?</p><p>Many thanks,</p>joshctaylorhttps://es.mathworks.com/matlabcentral/profile/authors/4833523-joshctaylortag:es.mathworks.com,2005:Question/3373532017-04-26T07:29:23Z2017-04-28T10:24:54ZHow to read html file stored on disk?<p>How to read html file stored on disk? webread function is reading only a URL and unable to read a file on disk. Please guide.</p>Abhishek Ballaneyhttps://es.mathworks.com/matlabcentral/profile/authors/6704237-abhishek-ballaneytag:es.mathworks.com,2005:Question/3377912017-04-28T10:20:16Z2017-04-28T10:20:16Zhow to use the perfcurve for ROC that has already been built<p>Hi I have used the following listing of code to create an ROC curve based on some testing that I had carried out. I was wanting to use the perfcurve to get the AUC and some other statistics on the ROC curve. Is it possible to use the perfcurve on an ROC curve that has already been created or if not could someone provide me with help on how to use the perfcurve function on what I already have.</p><pre class="language-matlab">Kmax =max(max(Finalprobs')) %set Kmax
Kmin = 0; %set Kmin
K=linspace(Kmin,Kmax,1000) ; %create 1000 K values evenly between Kmin and Kmax
Result1 =zeros(numel(K), 4); %create array "Result1"
for iK = 1:numel(K) %start of for loop iK
aK =K(iK); %set aK to increment through the values of K
TP=0;
TN=0;
FP=0;
FN=0;
</pre><pre> for confuseloopCO = 1:size(Finalprobs, 2) %for loop for TN and FP</pre><pre> if (Finalprobs(1,confuseloopCO)) > aK
TN=TN+1; </pre><pre> else
FP=FP+1; </pre><pre> end</pre><pre> if (Finalprobs(2,confuseloopCO)) > aK %for loop for FN and TP
FN=FN+1; </pre><pre> else
TP=TP+1; </pre><pre> end
end
Result1(iK,:) = [TP, FN, FP, TN]; %insert values of TP,FN,FP,TN into
%Result1 during for loop iK
end</pre><pre class="language-matlab">sens = Result1(:,1)/1000
spec = Result1(:,4)/1000
x = (1-spec)
y = (sens)
</pre><pre class="language-matlab">figure 1;
plot(x,y,'r')
title('ROC Curve for QTc Data with Control Probability', 'FontSize', 16)
xlabel('1-Specificity', 'FontSize', 14)
ylabel('Sensitivity', 'FontSize', 14)
</pre><p>If needs be in can upload the entire code being used but it is rather long.</p><p>Cheers,</p><p>Ross</p>Ross Johnstonhttps://es.mathworks.com/matlabcentral/profile/authors/9813061-ross-johnstontag:es.mathworks.com,2005:Question/3377802017-04-28T08:42:19Z2017-04-28T10:11:40ZComparing matrices of different length <p>I have two matrices of different length. For both matrices the first column is x-coordinate, second column is y-coordinate and third column is height.
I would like to compare all points for both matrices and for those points where the distance is less than 100 it should calculate the height difference.
Is there a smart way of doing this?</p>JVMhttps://es.mathworks.com/matlabcentral/profile/authors/7746355-jvmtag:es.mathworks.com,2005:Question/3329502017-03-31T10:46:21Z2017-04-28T10:06:24ZHi everybody,I need a program of segmentation using CNN(convolutional neural network)<p>Hi everybody,I need a program of segmentation using CNN(convolutional neural network)</p>mosbahi sourourhttps://es.mathworks.com/matlabcentral/profile/authors/5624637-mosbahi-sourourtag:es.mathworks.com,2005:Question/3377892017-04-28T09:52:31Z2017-04-28T09:52:31ZCan I combine solving a system of equations and bootstrp over each entry?<p>I have a linear square system Ax=b, where A is a 4x4 matrix and x and b are column vectors. x is the solution I am looking for. I have many measurements for each entry in A and b, e.g. for a 2x2 system:</p><p>A=[a11 a12;a21 a22], b=[b1;b2] with a11=[.;.;.;.;.]', a12=[.;.;.;.;.]', ... b2=[.;.;.;.;.]', where the .s are numbers. (Initially aij and bi are separate data files with one long column of numbers, but all entries in the ith line have to go together as they were measured at the same time in a MC simulation.)
What I would like to do is to solve the system for many bootstrap samples and then to determine the bootstrap average and the variance. I.e.:</p><ol><li>create one bootstrap sample</li><li>calculate x for each line of data e.g. if the indices of the bootstrap sample were (1,3,2,2,4) calculate x with the first entry in each vector aij,bi, then with the third, second, second, forth</li><li>average over x of the first sample</li><li>repeat 1-3 to get s bootstrap samples and so s different x_b</li><li>average over the x_b and compute the variance.
I am wondering if it is possible to use bootstrp at all because only writing</li></ol><pre class="language-matlab">bootstrp(s,@linsolve,A,b)
</pre><p>doesn't solve a system of equations but only one equation and takes the column vectors as the set of measurements and bootstraps over them. I've tried a three-dimensional construct but didn't get it to work. Could someone please tell me if I can use bootstrp at all for my problem and if so how? I know I could just write the bootstrap procedure myself but this would be a wonderful shortcut.</p><p>Thanks a lot!</p>Susanne Ehrethttps://es.mathworks.com/matlabcentral/profile/authors/10189136-susanne-ehrettag:es.mathworks.com,2005:Question/3346002017-04-10T11:20:11Z2017-04-28T09:50:37ZIntegrating multiple callbacks in a GUI window<p>I have been trying for an extended period of time to share data among the apps of a GUI window. I have several codes to format data and navigate through but each time i attempt to create a common code between callbacks I generate an error. I have looked at the MathWorks page for sharing data among callbacks with no luck as of yet. At the moment I need to create a window with an axis, a push button and a slider so that i can test if my slider code is working.</p><pre class="language-matlab">function varargout = push_slider(varargin)
% PUSH_SLIDER MATLAB code for push_slider.fig
% PUSH_SLIDER, by itself, creates a new PUSH_SLIDER or raises the existing
% singleton*.
%
% H = PUSH_SLIDER returns the handle to a new PUSH_SLIDER or the handle to
% the existing singleton*.
%
% PUSH_SLIDER('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in PUSH_SLIDER.M with the given input arguments.
%
% PUSH_SLIDER('Property','Value',...) creates a new PUSH_SLIDER or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before push_slider_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to push_slider_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
</pre><pre class="language-matlab">% Edit the above text to modify the response to help push_slider
</pre><pre class="language-matlab">% Last Modified by GUIDE v2.5 06-Apr-2017 13:10:23
</pre><pre class="language-matlab">% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @push_slider_OpeningFcn, ...
'gui_OutputFcn', @push_slider_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
</pre><pre class="language-matlab">if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
</pre><pre class="language-matlab">% --- Executes just before push_slider is made visible.
function push_slider_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 push_slider (see VARARGIN)
</pre><pre class="language-matlab">% Choose default command line output for push_slider
handles.output = hObject;
</pre><pre class="language-matlab">% Update handles structure
guidata(hObject, handles);
</pre><pre class="language-matlab">% UIWAIT makes push_slider wait for user response (see UIRESUME)
% uiwait(handles.figure1);
</pre><pre class="language-matlab">% --- Outputs from this function are returned to the command line.
function varargout = push_slider_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)
</pre><pre class="language-matlab">% Get default command line output from handles structure
varargout{1} = handles.output;
</pre><pre class="language-matlab">% --- 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)
guidata(hObject, handles);
myFolder = uigetdir('C:\Users\c13459232\Documents\MATLAB'); % Generate command window to choose a folder
if ~isdir(myFolder) % if the directory is not a valid path
errorMessage = sprintf('Error: the following folder does not exist: \n%s', myFolder); % print this error message
uiwait(warndlg(errorMessage)); % block the execution of program and wait to resume
return;
end
outFolder = fullfile(myFolder, 'output'); % build full file name from parts in folder 'Output'
mkdir(outFolder); % create folder
filePattern = fullfile(myFolder, '*.asc'); % Call all files with '.asc' from the chosen folder
Files = dir(filePattern); % list folder contents
finishCell = cell(length(Files));
for k = 1 : length(Files) % for all files files in the folder
baseFileName = Files(k).name;
FileName = fullfile(myFolder, baseFileName);
fid = fopen(FileName); % open the file from chosen folder
Cell = textscan( fid, '%d', 'delimiter', ';'); % scanning data from files
fclose(fid); % close file from chosen folder
Data = cell2mat(Cell); % convert the cell data to matrix
N = 1024; % Number of numbers per row
skip = 2;
Finish0 = reshape(Data, N, [])'; % reshape the data into the correct format
Finish1 = Finish0(1:skip:end, 1:skip:end);
finishCell{k} = Finish1;
end
</pre><pre class="language-matlab">% --- Executes on slider movement.
function slider1_Callback(hObject, eventdata, handles)
% hObject handle to slider1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
</pre><pre class="language-matlab">% Hints: get(hObject,'Value') returns position of slider
% get(hObject,'Min') and get(hObject,'Max') to determine range of slider
SliderValue = get( handles.slider, 'value');
x = SliderValue;
z = (SliderValue - 1);
Value = contourf(finishCell{x,1});
PreviousValue = contourf(finishCell{z,1});
</pre><pre class="language-matlab">% --- Executes during object creation, after setting all properties.
function slider1_CreateFcn(hObject, eventdata, handles)
% hObject handle to slider1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
</pre><pre class="language-matlab">% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor',[.9 .9 .9]);
end
</pre><p>I'm not sure how I can specify that the finishCell value created by the push button is what will be navigated through using the slider. Honestly any tips that anyone can provide would be greatly appreciated as staring at this code and mathworks pages has led me here as a last resort.</p>Aaron Smithhttps://es.mathworks.com/matlabcentral/profile/authors/9670029-aaron-smithtag:es.mathworks.com,2005:Question/3377882017-04-28T09:47:03Z2017-04-28T09:48:09Zcan't find my license number for matlab<p>can't find my license number for matlab what to do?</p>yael friedlerhttps://es.mathworks.com/matlabcentral/profile/authors/10234895-yael-friedlertag:es.mathworks.com,2005:Question/3374682017-04-26T17:52:29Z2017-04-28T09:47:33ZHow to get orthogonal eigenvectors for degenerate normal matrix?<p>I know that Matlab can guarantee the eigenvectors of a real symmetric matrix are orthogonal. In fact, for a general normal matrix which has degenerate eigenvalues, we can always find a set of orthogonal eigenvectors as well. But as I tried, Matlab usually just give me eigenvectors and they are not necessarily orthogonal.
Is there any function that can give orthogonal eigenvectors, or is there some fancy alternative way to do it?
Thanks!</p>Zekun Zhuanghttps://es.mathworks.com/matlabcentral/profile/authors/5550681-zekun-zhuangtag:es.mathworks.com,2005:Question/3377852017-04-28T09:13:20Z2017-04-28T09:39:44ZHow to run matlab scripts on cloud and collect the results<p>I want to collect some results generated by Matlab scripts. On my machine, it will take days. Is it possible to run matlab scripts on cloud and collect the results.</p>Atinesh Singhhttps://es.mathworks.com/matlabcentral/profile/authors/8382894-atinesh-singhtag:es.mathworks.com,2005:Question/3377862017-04-28T09:38:36Z2017-04-28T09:38:36ZPrimary user detection with multiple antennas<p>Hi. can someone help me to check the error in this code? I suppose to detect the primary user for multiple transmitter and display it in pd vs pfa form where the PU is detected when Cn >threshold value which is 3.</p><p>I actually didnt know how to relate the last l(i) code with the pd and pfa form.</p><pre> if true
L=10000; %number of sample taken
snrdb=10;
snr=10.^(snrdb./10);
pfa=0.001:0.001:1;
n = randn(1,L); %AWGN noise with mean 0 and variance 1
s = sqrt(snr).*randn(1,L); %Real value of Gaussian PU
M=2; %number of transmitter
y = s+n; %Received signal at PU existence
tx = M*y;%number of transmitter
%EGC is process by CUSUM before transmit
for i=1:1:200;
z(i)=(abs(tx(i))).^2; %EG combiner
l(i)= ((z(i).*3)./(4))+ (M.*(log(1./4)));
thresh(i) = (qfuncinv(pfa(i))./sqrt(L))+3;</pre><pre> if l(i)<thresh (i)
l(i) = false
else
l(i) = l(i-1)+l(i)
end
l(i)
end
pd(i) = i./100;
%awgn channel
plot(pfa,pd(i),'r')
xlabel('pd')
ylabel('pd')</pre><pre class="language-matlab">end
</pre>Miley Shttps://es.mathworks.com/matlabcentral/profile/authors/10234883-miley-s