https://nl.mathworks.com/matlabcentral/answers/questionsMATLAB Answers — New Questions2019-11-14T06:00:36Ztag:nl.mathworks.com,2005:Question/4910112019-11-14T06:00:36Z2019-11-14T06:00:36Zhas a degenerate mass distribution on its follower side. errorhas a degenerate mass distribution on its follower side.
The problem arises when using pulley.Na Hyun Leehttps://nl.mathworks.com/matlabcentral/profile/authors/15604733-na-hyun-leetag:nl.mathworks.com,2005:Question/4900672019-11-09T00:42:01Z2019-11-14T05:57:17ZPoor R2019b performance with tablesI read that there were improvements in table object performance in 2019b (at least with subsref stuff). I put together a simple script and directly compared r2019b to r2018b, both fresh installations.
2019b was much slower than 2018b. If this is unexpected, how can I figure out what is going wrong?
clearvars -except t
t = readtable('patients.dat');
var1 = 'Location';
var2 = 'Age';
nt = 1e4;
tic
for i=1:nt
t.Age(3) = 20;
end
fprintf('case 1: %g\n',toc);
tic
for i=1:nt
t.Location = t.Age;
end
fprintf('case 2: %g\n',toc);
tic
for i=1:nt
t.(var1) = t.(var2);
end
fprintf('case 3: %g\n',toc);
tic
for i=1:nt
t.(var2)(3) = 20;
end
fprintf('case 4: %g\n',toc);
R2018b:
case 1: 0.987709
case 2: 0.817124
case 3: 0.741722
case 4: 0.922625
R2019b:
case 1: 1.64177
case 2: 1.20244
case 3: 1.19423
case 4: 1.5782jghttps://nl.mathworks.com/matlabcentral/profile/authors/7291869-jgtag:nl.mathworks.com,2005:Question/4702322019-07-04T11:12:46Z2019-11-14T05:47:48Z number of WBC's in an image based on size.i have written a code to find the number of WBC's in an image based on size. But once the WBC's are highlighted the imfindcircles is not finding it and it is not getting counted.
sum=0;
for l= 104:104
jpgFilename = strcat('2_images_', num2str(l), '.jpg');
wbc=imread('2_images_104.jpg');
figure(1);
imshow(wbc);
title('original image');
%%converted into gray scale
wbc1=rgb2gray(wbc);
%%thresholding
T=64;
[m n]=size(wbc1)
for i=1:m
for j=1:n
if wbc1(i,j)>T
wbc1(i,j)=255;
else
wbc1(i,j)=0;
end
end
end
figure(2);
imshow(wbc1);
title('thresholded');
%%complement the image
wbc2=imcomplement(wbc1);
%%erosion of the image
A1 = strel('diamond',1);
A=imerode(wbc2,A1);
A2=imerode(A,A1);
A3=imerode(A2,A1);
figure(3);
imshow(A3);
title('eroded');
%%using edge detection
BW1 = edge(A3,'canny');
figure(4);
imshow(BW1);
title('edge detection');
A1=strel('diamond',3);
BW2=imdilate(BW1,A1);
BW3=imdilate(BW1,A1);
BW4=imdilate(BW3,A1);
figure(5);
imshow(BW4);
title('dilated');
BW5=imfill(BW4,'holes');
%%counting the number of WBC
[centers, radii, metric] = imfindcircles(BW5,[1 2],'ObjectPolarity','dark','Sensitivity',0.86,'Method','twostage');
m = viscircles(centers,radii);
[a,b]=size(centers);
fprintf('the number of WBCs in an image %d\n',a);
sum=sum+(a);
end
fprintf('the total number of WBCs in all images %d',sum);
this is the code. please help me Ragini Narasimhahttps://nl.mathworks.com/matlabcentral/profile/authors/13959813-ragini-narasimhatag:nl.mathworks.com,2005:Question/4907492019-11-12T21:50:34Z2019-11-14T05:45:59ZAveraging 30 arrays into one using functionHello,
I have many different arrays of certain days, and I need to average (using mean) them into month sections. This means averaging 30 or 31 different arrays.
Here is code I have to extract the data from the netCDF file (which works):
function x = read_aice_d(filename,day)
count = [Inf,Inf,1];
stride = [1,1,1];
startLoc = [1,1,day];
x = ncread(filename,'aice_d',startLoc,count,stride);
end
However, I am trying to make a function that will extract 30 of these arrays at once (each array is 320x104 double) and then average those into one array. I am currently stuck on how to do that. Thank you in advance!jschen1https://nl.mathworks.com/matlabcentral/profile/authors/14621410-jschen1tag:nl.mathworks.com,2005:Question/4910092019-11-14T05:43:42Z2019-11-14T05:43:42ZCounting types of WBCHello all
I want to count the types of WBC cells individually and for that I want the algorithm to count it . For that if anyone can help than please share your comments
My mail id is : harshal.faldu103396@marwadiuniversity.ac.in
manharsinh.jadeja103215@marwadiuniversity.ac.in
Please help for thisHarshal Falduhttps://nl.mathworks.com/matlabcentral/profile/authors/16851588-harshal-faldutag:nl.mathworks.com,2005:Question/4908352019-11-13T10:41:41Z2019-11-14T05:40:47Zwant to join two audio files and write /save using audiowrite close all;clear all;clc
[y1,Fs] = audioread('a.wav');
[y2,Fs] = audioread('b.wav');
y3 = [y1; y2;];
sound(y3,16000)
audiowrite(y3,Fs,xx)
audiowrite function is not working..please explainlibrahttps://nl.mathworks.com/matlabcentral/profile/authors/6569253-libratag:nl.mathworks.com,2005:Question/4909872019-11-14T01:44:12Z2019-11-14T05:26:22Zvpa doesn't seem to workSo I am trying to figure out how to use vpa(#,d) to do calculations with massive numbers on the magnitude of 1 x 10^(233) and need to know exactly down to the ones place. I have symbolic toolbox (syms x works). I have the student package if that helps.
When I do:
n = vpa(26666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666,300);
disp(n)
I get
26666666666666664495576118479230905243264565232272359586606331654070606440955821114246602026241719460353816553395244433385163782965564092296761476436932581062453237774063919113395968897415818722241311296600328363621654143835408695296.0
Why does it look like it is still having roud off error after 16 digits?Jacob Kelleyhttps://nl.mathworks.com/matlabcentral/profile/authors/12705434-jacob-kelleytag:nl.mathworks.com,2005:Question/4899312019-11-08T08:57:41Z2019-11-14T05:25:33ZHow to update the resistance parameter during the simulation of an AC3_Sensorless drive https://in.mathworks.com/help/physmod/sps/examples/ac3-sensorless-field-oriented-control-induction-motor-drive.html
in this drive i want to run the simulation for 3second but after 1.5 second i want that the resistance of the drive will automatically changed without stopping the drive for rest of the 1.5 second simulation
*stator resistance manish kumarhttps://nl.mathworks.com/matlabcentral/profile/authors/11716896-manish-kumartag:nl.mathworks.com,2005:Question/4910022019-11-14T03:56:31Z2019-11-14T05:24:56Zvpa adding ".0" to the endSo I am needing to use vpa(#,d) for a very large number on the magnitude of 1x10^(250). I've figured out how to use it but for some reason it adds .0 to the end which I can't have.
example:
n = vpa('3546',32)
disp(n)
output:
3546.0
The reason I can't have the .0 is because I am constructing a sequence that depends on if there are any 0s in the number and the ".0" at the end makes it think it always has a 0 in the number
N = string(n);
strlength(N)
N = convertStringsToChars(N);
for i = 1:strlength(N)
if N(i) == '0' || N(i) == '1' || N(i) == '5'
disp('N(i) = 0,1,5')
skpchk = 'True';
break;
end
endJacob Kelleyhttps://nl.mathworks.com/matlabcentral/profile/authors/12705434-jacob-kelleytag:nl.mathworks.com,2005:Question/4910072019-11-14T04:35:58Z2019-11-14T05:16:58ZHow log is Student license?Hi!
Student license is lifetime or some years?
Thank you.Tu Lehttps://nl.mathworks.com/matlabcentral/profile/authors/12293426-tu-letag:nl.mathworks.com,2005:Question/4908532019-11-13T12:37:42Z2019-11-14T05:13:44ZHow to re-arrange swapped elements in an estimated vector as compared to a reference vectorI have a reference vector u=[0.5 1 1.5 0.6981 1.3962 1.5707].
I estimate several vectors of the same size using a metaheuristic algorithm. But the problem is that sometimes the algorithm gives me vectors in which the positions of elements are swapped and sometimes there is no change in the positions i.e. sometimes positios of 1st and 2nd elements are interchanged, sometimes positions of 1st and 3rd elemtns are interchnaged and sometimes positions of 2nd and 3rd eleents are interchanged with each other in the estimated vectors.And if the changes ocuurs in the positions of two elements in the 1st three elements, the same change occurs in the last three elements also.But sometimes the positions are not interchnaged in the estimated vectors. I want to re-arrange the estimated vector elements if they interchange their positions. What check should I keep on the positions of the elements of the estimated vectors. Regards,Sadiq Akbarhttps://nl.mathworks.com/matlabcentral/profile/authors/966774-sadiq-akbartag:nl.mathworks.com,2005:Question/4908492019-11-13T12:20:30Z2019-11-14T05:07:51ZActiveX: how to pass a string array to cst in matlab？hi, i'm using the activex interface to control cst(2019) by matlab(2018).matlab works fine as it comes to pass number and sting to cst.
However,when is comes to pass a string array, i get error:
Invalid double parameters array definition (not a valid string array).
I want to know how to pass a string array to cst in matlab.
the matlab code is:
oCSTApp = actxserver('CSTStudio.application');
oProject= oCSTApp.invoke('NewMWS');
Block = invoke(oProject,'Block');
Block.invoke('Reset')
Block.invoke('Type', 'MicrostripCoupledLinesIrregular')
Block.invoke('Name', 'MC2')
Block.invoke('SetIntegerProperty','Number Of Lines', 4)
sWidth={"0.5";"1.1";"2.2";"3.3"}
Block.invoke('SetDoubleArrayProperty','Widths', sWidth)(will get error here!)
the VBA code is ：
'Create a block
With Block
.Reset
.Type ("MicrostripCoupledLinesIrregular")
.Name ("MC2")
Dim sWidth(0 To 3) As String
sWidth(0) = "0.5"
sWidth(1) = "1.1"
sWidth(2) = "2.2"
sWidth(3) = "3.3"
.SetIntegerProperty("Number Of Lines", 4)
.SetDoubleArrayProperty("Widths", sWidth)
.Position(51050, 51000)
.Create
End Withlianghttps://nl.mathworks.com/matlabcentral/profile/authors/5699181-liangtag:nl.mathworks.com,2005:Question/4813092019-09-20T10:49:12Z2019-11-14T05:05:31Zproblem with if/else if blockHello,
I will try to be as clear as possible: I have a problem with if/else if block and maybe it comes from sampling time that I've never used before...
Here's a subsystem B:
this subsystem is inside a bigger one A
FRB and HDB are coming from outside of A, from excel spreadsheet, with sampling time 3600
Tb1 enters into B, coming from A itself, so no condition of sampling applied
Inside B I have :
when I plot TB1, it comes as it should (confronting with the plot where Tb1 is generated), but when I go into the if block:
and I plot again TB1, I have a different graph, constant as if it was "maintaining" the value for 3600s since signals HDB and FRB comes from the worksheet with this sampling time...
I know nothing about sampling time and I really don't know how to deal with that.
My excel sheet is very big and I have data every hour (3600s) that is why I put this sampling time, nowhere in my model I have put this condition but Ii think that everywhere these data will be in use, I will encounter this problem.
Thank you for any help/advice/comment
ChristineChristinehttps://nl.mathworks.com/matlabcentral/profile/authors/13049384-christinetag:nl.mathworks.com,2005:Question/4908132019-11-13T08:21:31Z2019-11-14T04:55:02ZImport data from multiple .dat files, remove headerlines, and read columns into array - but the number of headerlines differs across each .dat fileI have a large number of .dat files in a folder sorted under names in the format "author_energy_radiationtype_cellline", and I am using the "dir" command to select the files that apply to particular energies, cell lines etc. Each .dat file has between 2 and 7 headerlines I want to skip. The files have the following format.
"SF(Dose (Gy)) created by Plot Digitizer 2.6.8"
"Date: 1/17/19 8:41:06 AM"
author year mod cell_line energy let
**** 2008 protons *** 6MV -$\mu$m
alpha alpha_err beta beta_err alpha_X alpha_X_err beta_X beta_X_err
0.291 0.000 0.041 0.000 0.291 0.000 0.041 0.000
Dose (Gy) SF Error
0.8312 0.7674 0.9121
1.8470 0.4560 0.5615
2.8600 0.2924 0.3457
4.8985 0.0761 0.1244
6.9425 0.0218 0.0344
I want to read the data under the 'Dose', 'SF', and 'Error' columns read into arrays, and I also need to extract the first and third values in the 6th row. Is there any way to do this when the number of headerlines changes from file to file?
This is my code so far. I can pick out the files with certain energies, etc. I can't seem to figure out how to actually extract the data in the way I described above.
% Specify the folder where files are located
myFolder = 'C:\Users\..\Desktop\CellSurvivalData';
% Check to make sure that folder actually exists. Warn user if it doesn't.
if ~isdir(myFolder)
errorMessage = sprintf('Error: The following folder does not exist:\n%s', myFolder);
uiwait(warndlg(errorMessage));
return;
end
% Get a list of all files in the folder with the desired file name pattern.
filePattern = fullfile(myFolder, '*235MeV*HSG*'); % Define desired parameters
theFiles = dir(filePattern); % List the files which satisfy these parameters
for k = 1 : length(theFiles)
baseFileName = theFiles(k).name;
fullFileName = fullfile(myFolder, baseFileName);
fprintf(1, 'Now reading %s\n', fullFileName);
% Read the data from each file
file{k} = readtable( fullFileName );
end
Melissa McIntyrehttps://nl.mathworks.com/matlabcentral/profile/authors/12560419-melissa-mcintyretag:nl.mathworks.com,2005:Question/4910082019-11-14T04:47:28Z2019-11-14T04:47:28Zask the qusetion about solving the implicit equation of LR-SP SR-SP modes
Hi, i want to ask the question when I do some simulation about LR-SP SR-SP modes about(postive and negative mean the two modes). later, we choose positive to simulate.
(the parameter above :
w(omega) is set in a row matrix like a array).
epsilond, epsilonmetal, c and d are known.
wc=(w.^2)./(c^2)
syms x
k1z=sqrt((x.^2)-epsilond.*wc)
k2z=sqrt((x.^2)-epsilonmetal.*wc)
f=((epsilonmetal.*k1z+epsilond.*k2z)./(epsilonmetal.*k1z-epsilond.*k2z))-exp(k2z.*d)
y=vpasolve(f==0,x)
after running, some trouble happened like this:
--------------------->>> Error using mupadengine/feval (line 195)
More equations than variables is only
supported for polynomial systems.
Error in sym/vpasolve (line 172)
sol =
eng.feval('symobj::vpasolve',eqns,vars,X0);
Error in Dispersion of imi (line 48)
y=vpasolve(T==0,x) <<<<<<-----------------
Could anyone help me, thanks a lot!!CHUN-HUNG Liuhttps://nl.mathworks.com/matlabcentral/profile/authors/13518751-chun-hung-liutag:nl.mathworks.com,2005:Question/4909772019-11-14T00:05:04Z2019-11-14T04:42:57ZHow do I locate all integer values within a matrix (of string and integer values in the same cell), then replace all those integer values with a 1 or 0 thus forming a new matrix with the replaced integers?"( x(2) | x(1) )"
"x(3)"
"( x(4) | x(6) | x(5) )"
"( x(7) | x(8) )"
"( x(7) | x(8) )"
""
"x(9)"
"( x(10) & x(11) & x(12) )"
"x(13)"
"( x(15) | x(14) | x(1) )"
The text above are in a column vector, but I need to replace the integers with a zero or one. Eg. All integer values not equal to two should be zeros (x(0)), whereas those equal to two should be '1' (x(1) Michael Trosshttps://nl.mathworks.com/matlabcentral/profile/authors/16207215-michael-trosstag:nl.mathworks.com,2005:Question/4910052019-11-14T04:28:51Z2019-11-14T04:28:51ZHow can we separate incoming real time data in MATLAB?Hi, I am getting serially real time data in MATLAB. Here is the data:
3597 2854 3598 2852 3568 2854 3597 2585.....
MATLAB code is-
clc
clear all
close all
delete(instrfind)
s=serial('COM3','BaudRate',9600,'Terminator','CR');
fopen(s);
counter=1;
t=0;
x=0;
while 1
tic
binary_data = fread(s, 5); %Read 5 bytes from serial port (5 uchar elements) to array binary_data.
str = char(binary_data'); %Convert uchar array to character array.
data = str2num(str)
data2=data/1000;
data1(counter)=data2
voltage=data1(1:2:counter+1);
% temp=data1(2:2:);
%ct = 0:1/1200:(counter-1)/1200
toc
if counter > 1
time(counter) = time(counter-1)+ toc;
else
time(counter) = toc;
end
plot(time,voltage);
ylim([3,5]);
ylabel('voltage');
xlabel('time');
drawnow
counter=counter+1;
end
I need to plot data 3597 3598 3568 3597..... and plot data3597 2854 2852 2854 2585...... seperately.How can i do this? Thanks.mohan khedkarhttps://nl.mathworks.com/matlabcentral/profile/authors/15335396-mohan-khedkartag:nl.mathworks.com,2005:Question/4910042019-11-14T04:21:08Z2019-11-14T04:21:08ZHow do i use boundary conditions to find variables in an equation Hi all. I am trying to find 4 variables which are c1, c2, c3, c4 in my equation using 4 boundary conditions. The value of lambda is known. But i donot know how to proceed. Any help is much appreciated.
My code is as follows:
lambda = 0.0275;
%Solution of the governing equation for beam-on-elastic-foundation is:
syms x c1 c2 c3 c4
u(x) = exp(lambda*x)*(c1*cos(lambda*x) + c2*sin(lambda*x)) +exp(-lambda*x)*(c3*cos(lambda*x) + c4*sin(lambda*x));
du(x) = diff(u,x);
%The boundary condition for the pile under node 01 on applying unit force on dof-01 is:
eqn1 = u(0)==1;
eqn2 = u(Lp)==0;
eqn3 = du(0)==0;
eqn4 = du(Lp)==0;
eqns = [eqn1 eqn2 eqn3 eqn4];
vars = [C1 C2 C3 C4];
soln = solve(u,eqns,vars);Ramneet Sidhuhttps://nl.mathworks.com/matlabcentral/profile/authors/16393817-ramneet-sidhutag:nl.mathworks.com,2005:Question/4909942019-11-14T02:54:39Z2019-11-14T04:14:45Zindex array to access the value in matrixHi all, I have 3 matrixes as matrix IM (200x200); X(400x400); Y(400x400). As matrix x and y is indexing the matrix IM. How can I use x and y matrix to access the value of matrix IM withouf for loop.AniCnxhttps://nl.mathworks.com/matlabcentral/profile/authors/7269710-anicnxtag:nl.mathworks.com,2005:Question/1535682014-09-05T14:31:59Z2019-11-14T04:07:54ZImplementing steganography in wavelet transformHi
here's my code for implementing steganography in wavelet transform, trying to hide text in cover image, but the problem is that when the text message is longer that 'hello' it wont work, I dont know how to fix it :)
by the way, If you can help me with other source codes for implementing steganography in wavelet transform especially image steganography in wavelet transform, I would really appreciate it :)
%clear all
%close all
%clc
im=imread('cameraman.tif');
wname='haar';
msg='Hello world';
data=[];
for(i=1:length(msg))
d=msg(i)+0;
data=[data d];
end
imshow(im);
[cA1,cH1,cV1,cD1] = dwt2(im,wname);
dec1 = [cA1 cH1;
cV1 cD1
];
figure
imshow(uint8(dec1));
M=max(data);
data_norm=data/M;
n=length(data);
[x y]=size(cH1);
cH1(1,1)=-1*n/10;
cH1(1,2)=-1*M/10;
for(i=1:1:ceil(n/2))
cV1(i,y)=data_norm(i);
end
for(i=ceil(n/2)+1:1:n)
cD1(i,y)=data_norm(i);
end
CODED1=idwt2(cA1,cH1,cV1,cD1,wname);
figure
imshow(uint8(CODED1))
[x y]=size(cA1);
imshow(uint8(CODED1))
ms=abs(CODED1-double(im));
ms=ms.*ms;
ms=mean(mean(ms))
ps= (255*255)/ms;
ps=10*log10(ps)
imwrite(uint8(CODED1),'Stego.bmp','bmp');
return
%%% END of encoding.m%%%%%%%%%%%%%%%%
%%%%% Decoding.m%%%%%%%%%%%%%%%%%
im=imread('Stego.bmp');
[cA11,cH11,cV11,cD11] = dwt2(CODED1,wname);
data=[]
data_norm=[];
n=ceil(abs(cH11(1,1)*10));
M=ceil(abs(cH11(1,2)*10));
for(i=1:1:ceil(n/2))
data_norm(i)=cV11(i,y);
end
for(i=ceil(n/2)+1:1:n)
data_norm(i)=cD11(i,y);
end
data=ceil(data_norm*M)-1;
msg='';
for(i=1:length(data))
msg=strcat(msg,data(i));
end
msg
%%End of Decoding.m
Ebrahimhttps://nl.mathworks.com/matlabcentral/profile/authors/5600312-ebrahimtag:nl.mathworks.com,2005:Question/3365342017-04-21T15:09:35Z2019-11-14T04:06:04Z3 phase unbalanced phases simulationHi Has anyone managed to simulate a 3 phase unbalanced circuit, it is only a simple circuit, with resistive loads but no matter what i replace the load with, it will not show a drop in the phase voltage for that particular phase.
<</matlabcentral/answers/uploaded_files/75745/Unbalance%20phases.JPG>>
Thank you in advance
MikeMike Hursthttps://nl.mathworks.com/matlabcentral/profile/authors/10032719-mike-hursttag:nl.mathworks.com,2005:Question/4910032019-11-14T04:01:48Z2019-11-14T04:01:48ZPlot data arrays from loaded data structure fileHello, I am not understanding the difference in my loaded data arrays. I have a 1x1001 array that I can plot just fine, but I want to plot it against arrays that are in the data structure as well. These other arrays have a 1x1x1001 structure, which I don't understand what that means, but I assume that is the reason the error "Data cannot have more than 2 dimensions" pops up when I try to plot both arrays. Do you have any suggestions for this? See screen shot for error.
load("Bode_result_shunted.mat")
plot(data.OMEGA,data.MAG)
xlabel('Omega (rad/s)'), ylabel('Magnitude')Shane Palmerhttps://nl.mathworks.com/matlabcentral/profile/authors/16534237-shane-palmertag:nl.mathworks.com,2005:Question/2944032016-07-08T20:55:29Z2019-11-14T03:42:13ZMatlab Compiled Standalone App Very Large SizeHi,
I recently wrote a small Matlab script which only uses a few GUI elements (made with GUIDE), file reading/saving and plotting.
When I compile it shows its size at 907mb, I'm sure that my tiny program (which just asks for a file selection, plots some data, then give the option to save the data) should probably not have a 907mb .exe
Looking around online hasn't helped much, does anybody here have any idea why it's so huge, and what I could do to fix it? As a test I made a new script which just has 'a = 1 + 2;' in it, compiling this takes up the same 907mb of space... so I'm sure I'm doing something wrong, I just don't know what.
Thanks,
Robert
EDIT: Ah, after reading a bit more I think I understand, so the MCR is ~907mb and is required for every standalone application? Time to brush up on my C++ I guess.Robert Roscahttps://nl.mathworks.com/matlabcentral/profile/authors/6235667-robert-roscatag:nl.mathworks.com,2005:Question/4910002019-11-14T03:41:54Z2019-11-14T03:41:54ZCan I put vectors in the table data of lookup tables?when i try to type in a vector/matrix in the table data, there's a alert said that "Entry is not an valid finite number. Changes has been voided."Jiang Changhttps://nl.mathworks.com/matlabcentral/profile/authors/14896218-jiang-changtag:nl.mathworks.com,2005:Question/4908202019-11-13T09:10:02Z2019-11-14T03:30:40ZFind the list of edges between 2 nodesI've the following graph with multiple edges.
tail = [1 2 2 4 5 3]
head = [2 4 5 3 3 6]
I would like to know how to find the list of edges between nodes 2 and 3.
Expected output = [2 4 3]
[2 5 3]
I tried using shortestpath for simple graphs. But for multigraph it gives one path. I'd like to know how to
obtain both paths.
Deepa Maheshvarehttps://nl.mathworks.com/matlabcentral/profile/authors/8575091-deepa-maheshvaretag:nl.mathworks.com,2005:Question/4909982019-11-14T03:21:11Z2019-11-14T03:22:15ZHow to initialize an array such that the values satisfies an equationHi
Is there a way to initialize α = {α1, . . . , αL} randomly subject to constraint
sum(y(i)*α(i)) = 0
. for all values of i
y takes values of either +1 or -1
Thanks
Nadia Ahttps://nl.mathworks.com/matlabcentral/profile/authors/8246779-nadia-atag:nl.mathworks.com,2005:Question/4909992019-11-14T03:22:06Z2019-11-14T03:22:06ZWhat do these different colors of stem plot indicates?This is the stem plot for a complex value matrix of size 512x40. What does these different coluors indicates ?
How to unayse this stem diagrams?
What does the spacing of stem lines indicates ?
Vishwaraj Manurhttps://nl.mathworks.com/matlabcentral/profile/authors/7896906-vishwaraj-manurtag:nl.mathworks.com,2005:Question/4909972019-11-14T03:19:26Z2019-11-14T03:19:26ZSpectral Clustering of ImageHello,
I want ask, How does spectral clustering to denoise an image like in this image?
Many Thanks in advance.
Reference for this image: Robust x-ray image segmentation by spectral clustering and active shape model (Wu J. and Mahfouz M.R, 2016)Nurul Maulidiyahhttps://nl.mathworks.com/matlabcentral/profile/authors/16211844-nurul-maulidiyahtag:nl.mathworks.com,2005:Question/4909862019-11-14T01:41:32Z2019-11-14T03:17:59ZRead matriz from text fileHello, i am new to Matlab, and i still coudn't find a way to read a text file, organized like it was a table, and get the matriz in it. The first line of the file are the names of the citys, and rest of the lines are the matriz, wich each position corresponds to the distance between the cities. My objective is to read the cities and put them in an array, and get the matriz with only the numbers;
can someone help me?
Salmorrete, Vila Lo, Piao, Tortolindo, Chao de Frades
0 104 97 33 205
0 0 46 57 410
0 0 0 154 73
0 0 0 0 322
0 0 0 0 0José Sobrinhohttps://nl.mathworks.com/matlabcentral/profile/authors/16580386-jose-sobrinhotag:nl.mathworks.com,2005:Question/4753312019-08-08T04:30:48Z2019-11-14T03:10:38Z3D CNN target vectorI have created a 3D CNN in MATLAB 201a.
My 3D - input size is 16x1280x3x42662 - height x width x depth x n:of observations. My target vector is a categorical array of size: 42662x1.
While I train, I get an error: "Number of observations in X and Y disagree." Can someone please help me on where I am going wrong.
Thanks for your time and help.Venkathttps://nl.mathworks.com/matlabcentral/profile/authors/6240383-venkattag:nl.mathworks.com,2005:Question/4905922019-11-12T07:04:22Z2019-11-14T03:06:51ZWhy I can't use trainetwork for the CNN3D using convolution3DLayerHere is my code:
clc;clear all;
%%
X_train = zeros(9,9,4,20);
Y_train = categorical(randi(2,[20,1]));
%%
trainD=X_train;
targetD=Y_train;
[row collum di]=size(trainD(:,:,:,1));
%% Define Network Architecture
% Define the convolutional neural network architecture.
lgraph = layerGraph;
layers = [
image3dInputLayer([row collum di 1],'Name','input') % 9x9x4x1 refers to number of features per sample
convolution3dLayer([2 2 2],5,'stride',[1 1 1],'padding','same','Name','conv_1')
batchNormalizationLayer('Name','BN_1')
reluLayer('Name','Relu_1')
dropoutLayer(0.5,'Name','Dropout1')
fullyConnectedLayer(1024,'Name','Fc1')
fullyConnectedLayer(2,'Name','Fc2')
softmaxLayer('Name','Softmax')
classificationLayer('Name','ClassOutput')];
options = trainingOptions('adam',...
'MaxEpochs',1000, ...
'Shuffle','every-epoch', ...
'InitialLearnRate',1.0000e-04, ...
'L2Regularization',0.5,...
'Verbose',true,...
'VerboseFrequency',5,...
'Plots','training-progress',...
'OutputFcn',@(info)stopIfAccuracyNotImproving(info,3));
%%
net = trainNetwork(trainD,targetD,layers,options);
predictedLabels = classify(net,trainD)';
%%
%caculate accuracy (need change code a litte (do later))
YPred = classify(net,valD);%fix this add our eeg
YValidation = vallab;%fix this add our label
accuracy = sum(YPred == YValidation)/numel(YValidation)*100
The error is:
Error using trainNetwork (line 165)
Number of observations in X and Y disagree.
Error in test_CNN3D (line 48)
net = trainNetwork(trainD,targetD,layers,options);
I need some help as soon as possible please.
Thanks Huynh Quoc Viethttps://nl.mathworks.com/matlabcentral/profile/authors/15890231-huynh-quoc-viettag:nl.mathworks.com,2005:Question/4909582019-11-13T21:36:15Z2019-11-14T03:05:18Zhow do bins in histograms work? Hello! I am working on a homework assignment where we are given a 1000x1000x1000 logical matrix and we want to create a histogram showing the number of ones in each layer of the matrix. I went through, indexed each of the 1000 layers and counted the number of zeros, but I am now having trouble with the bins on my histogram. I want to plot it so that the x axis has a bar for each of the 1000 layers and the y axis shows how many 1s were in each layer. When I specify the number of bins as 1000, my X axis goes from (0 to 2.5)*10^5 and my y axis goes from 0 to 50, and when I don't specify the bins at all by x axis goes from (0 to 3)*10^5 and my y axis goes from 0 to 900. Is there something wrong with my code that counts the ones, or am I misunderstanding something about histograms and bins? Is what I want to do with my histogram even possible? Thank you!Julia Dunnhttps://nl.mathworks.com/matlabcentral/profile/authors/16043985-julia-dunntag:nl.mathworks.com,2005:Question/4909952019-11-14T03:02:33Z2019-11-14T03:02:33ZWhat is the Shape of the Spectrum?Hello Guys!!!
I'm trying to solve Q1 and Q2 in the attached document 'PracticalWork_1920.pdf '. This is my code so far. Can anyone help me?
clc
clear all
close all
myData = importdata('bathymetry.dat');
x = myData(:,1);
z = myData(:,2);
%Plot data
figure(1)
plot(x,z,'b')
grid on
axis tight
xlabel ('Longitude {\circ}')
ylabel ('Water depth (m)')
title('Bathymetry Profile')
%%
%Fully-developed sea
load('FDS.mat') %range from -40 to -2.4(the observer)
longitude = FDS(:,1);
depth = -FDS(:,2);
figure(2);
plot(longitude,-depth);
grid on
axis tight
xlabel ('Longitude {\circ}')
ylabel ('Water depth (m)')
title('Fully-Developed Sea Profile')
%Constant variable
gravity = 9.81; %m/s^2
EarthRadius = 6371000; %in m
% Define the frequency vector
Tmin = 3;
Tmax = 30;
nFreq = 30;
fmin = 1/Tmax;
fmax = 1/Tmin;
f = linspace(fmin,fmax,nFreq);
% Define JONSWAP spectrum parameters
Hs = 5; % in m
Tp = 20; % in s
gam = 3; % gamma factor is always greater than 1
%%
% In this function, f=0 should be excluded
S = JONSWAP_spectrum(f,Hs,Tp,gam);
%
figure(3);
plot(f,S)
xlabel('Frequency (Hz)')
ylabel('Wave spectrum in (m^2/s)')
title('The JONSWAP Spectrum')
%set(findall(gcf, '-property', 'FontSize'), 'FontSize', 14)
%
%%
% Decomposition of the wave spectrum into regular waves
% The row of dt is 30
nWaves = numel(f);
df = f(2) - f(1);
for i = 1:nWaves
a(i,1) = sqrt(2*S(i)*df);
omega(i,1) = 2*pi*f(i);
k(i,1) = kfromw(omega(i,1), depth(1), gravity);
cg(i,1) = 0.5*omega(i,1)/k(i); % check the 1/2 in the formula
xg(i,1) = 0; % Initial position
dt(i,1) = 0; % Initial position
end
%%
% Evolution equations
% The column of dt is 2257
ndepth = size(FDS,1);
for it = 2:ndepth %(in hours)
for i = 1:nWaves
a(i,it) = a(i,1); % no dissipation / dispersion
omega(i,it) = omega(i,1); % the frequency is not changed
k(i,it) = kfromw(omega(i,it), depth(it),gravity); % Wave number associated with depth
cg(i,it) = 0.5*omega(i,1)/k(i,it); % group velocity
dtheta = (longitude(it)-longitude(it-1))/180*pi;
dx(i,it) = EarthRadius*dtheta;
dt(i,it) = dx(i,it)/cg(i,it);
end
end
Muhammad Fakhruddin Abd Rahimhttps://nl.mathworks.com/matlabcentral/profile/authors/16768748-muhammad-fakhruddin-abd-rahimtag:nl.mathworks.com,2005:Question/4909822019-11-14T01:12:07Z2019-11-14T02:54:32ZPrecision in write() function. Arduino packageHi guys! I am having problems using MATLAB® Support Package for Arduino® Hardware to control LEDs with 5 74HC595 8-bit serial-in-parallel-out shift registers.
I have to control 40 LEDs using 5 shift register and I am not able to expand matlab example, present here https://www.mathworks.com/help/supportpkg/arduinoio/ug/control-leds-with-74hc595-shift-register.html.
In the example two 74HC595 shift registers are used instead of five in this way:
a = arduino('COM4','Uno','Libraries','ShiftRegister')
dataPin = 'D8';
clockPin = 'D9';
latchPin = 'D10';
resetPin = 'D11';
register = shiftRegister(a,'74HC595',dataPin,clockPin,latchPin,resetPin)
sequenceTable = tril(ones(16));
for count = 1:16
write(register,sequenceTable(count,:),'uint16');
pause(0.5);
end
My problem is in the write function. I would like to switch on/off all the 40 LEDs at the same but does not exist a data precision to control in one istruction all my LED
sequenceTable = ones(10,40);
for count = 1:10
write(register,sequenceTable(i,:),'....'); %How to write this instruction??
pause(0.5);
end
If I instead create sequenceTable in this way:
sequenceTable = ones(50,8);
for count = 1:50
write(register,sequenceTable(i,:),'uint8');
pause(0.5);
end
would it be possible to send out from the ShiftRegister to the LEDs the value only after calling 5 times the write function to switch on them all together?
Thank you guys in advance for the help! :)benl23https://nl.mathworks.com/matlabcentral/profile/authors/12330674-benl23tag:nl.mathworks.com,2005:Question/4909812019-11-14T00:35:04Z2019-11-14T02:52:22Zcalling a function in a loopI am writing a program in MATLAB to solve for the efficiency of a diesel engine based off of it's cutoff ratio.
I also need to plot efficiency vs cutoff ratio for a varying cutoff ratio from 1.3 to 2.8.
T1, P1, and r are user input and cp and k are constants.
The error message I keep getting says that the index is invalid. "Array indices must be positive integers or logical values."
for rc = 1.3:0.01:2.8
[P2, N, qin, T3, T4, P3, P4, wnet] = part_1(P1, k, cp, rc, r, T1);
i = i + 1;
y(i, :) = rc
x1(:,i) = N
end
%Plots
plot(x1,y)
xlabel('Efficiency')
ylabel('Cutoff Ratio')
title('Efficiency vs Cutoff Ratio')
Here is my function:
function [P2, N, qin, T3, T4, P3, P4, wnet] = part_1(P1, k, cp, rc, r, T1)
N = 1 - (1/r^(k-1))*((rc^k-1)/(k*(rc-1)));
T2 = T1*r^(k-1);
P2 = P1*r^k;
P3 = P2;
T3 = T2*rc;
T4 = T3*(rc/r)^(k-1);
P4 = P2*T2*(1/r);
qin = cp*(T3-T2);
wnet = N*qin;
endD Mhttps://nl.mathworks.com/matlabcentral/profile/authors/16391092-d-mtag:nl.mathworks.com,2005:Question/4909932019-11-14T02:52:13Z2019-11-14T02:52:13Zcreate matrix of xy coordinates with corresponding z valuesi have xy coordinates with corresponding class values stored in .txt file. i would like to create matrix of 5500,3700 and z values from txt file has to be place for corresponding xy coordinates position. please help me to sort outManikandan Sathiyanarayananhttps://nl.mathworks.com/matlabcentral/profile/authors/16833224-manikandan-sathiyanarayanantag:nl.mathworks.com,2005:Question/4909522019-11-13T21:23:06Z2019-11-14T02:38:23ZA function to find prime numberHello,
I wrote a function to find a prime number and would like to run it to find all prime numbers up to 100 from my starting point. However, I get an error saying "too many output arguments".
Here is what I have...
function isPrime(number)
tf=isprime(number);
if tf==true
disp(number)
end
end
starting_point=input("Enter your number: ");
while starting_point<100
disp(isPrime(starting_point))
starting_point=starting_point+1;
end
I would really appreciate if anyone can help me with this problem....Takashi Fukushimahttps://nl.mathworks.com/matlabcentral/profile/authors/16681937-takashi-fukushimatag:nl.mathworks.com,2005:Question/4909922019-11-14T02:38:06Z2019-11-14T02:38:06ZHow to save data stored in a cell for easy transfer to excel?I have data stored in excel based on timepoints. I wrote a small code that sepatates the data into intensities based on the time point indicated (Time 1, Time 2, etc.)
----------------------------------------------------------------------------------------------
[~,idx] = sort(data(:,2));
sortedmat = data(idx,:);
[~,~,X] = unique(sortedmat(:,2));
C=accumarray(X,1:size(sortedmat,1),[],@(r){sortedmat(r,:)});
Time = data(:,2) ;
Intensity = data(:,1) ;
[c,ia,ib] = unique(Time) ;
answer = cell(length(c),1) ;
for i = 1:length(c)
answer{i} = Intensity(ib==i,:) ;
end
-----------------------------------------------------------------------------------------------
However, the data is stored in a cell with individual "NX1 double" values. So far I have opened every single one of them and then copy and paste them into excel where i do the analysis. But my data sets are starting to become bigger and I am wondering if there is an easy way to either save them to a matrix that I can copy and paste to excel or another way to save them.
Thank you
Gerardo Mauleon Ramoshttps://nl.mathworks.com/matlabcentral/profile/authors/11970121-gerardo-mauleon-ramostag:nl.mathworks.com,2005:Question/4909902019-11-14T02:00:34Z2019-11-14T02:30:14ZPlotting Infinite series in matlab
e(t)=x(t)-xn(t), how can i plot e(t)??
Kyu Hwan Shimhttps://nl.mathworks.com/matlabcentral/profile/authors/16845248-kyu-hwan-shimtag:nl.mathworks.com,2005:Question/4908162019-11-13T08:43:22Z2019-11-14T02:29:45ZCreating Variables with GUI inputsI am trying to create a GUI with matlab and in order to make it work properly I need to ask for user input. I want to store these inputs in a variable and use them in the main part of my code. I have done some research but only found out that I could not create variables in a function and call them in an other fucntion. Is there anyway to do this? If so how would i incorperate it into my code?Erick Maganahttps://nl.mathworks.com/matlabcentral/profile/authors/12044592-erick-maganatag:nl.mathworks.com,2005:Question/4909912019-11-14T02:26:08Z2019-11-14T02:26:08ZUse trained nftool with new samplesAfter I completed the training process with nftool I saved the scripts and I run it and it just train again but now I want to test it with new samples to see the output but I didn't figure out how to do that!Pedro Vallehttps://nl.mathworks.com/matlabcentral/profile/authors/16849542-pedro-valletag:nl.mathworks.com,2005:Question/4909782019-11-14T00:05:39Z2019-11-14T01:53:39ZWriting Code for function with CSV and character arrayHow do you code for a function that returns a character array associated with a column from a character array in comma-separated values (CSV) format. Lauren Kinchlahttps://nl.mathworks.com/matlabcentral/profile/authors/16165196-lauren-kinchlatag:nl.mathworks.com,2005:Question/4909852019-11-14T01:40:08Z2019-11-14T01:53:00Zundefined variable error when the variable is theremy code was working yesterday but now it is telling me I have an undefined variable when the variable is stated. What do I do?
%Cape Cod, Massachusetts
l = 11000; %m length of canal (7 miles/11km)
d = 9.8; %m depth of canal MLLW
rho = 1025; %kg/m^3 seawater density
g = 9.81; %m/s^2 gravity constant
x = [0:100:l];
t = [0 (pi/2) pi (3*pi)/2];
%East
HTEam = 3.11; % m high water at the East on October 29rd, 2019
LTEam = -0.30;
%military time
HTEtam = 0018;% military time of high water at the East on October 29rd, 2019
LTEtam = 0622;
HTEtpm = 1236;
LTEtpm = 1855;
TE = (HTEtpm-HTEtam);
fprintf('East tidal period = %1.0f (military time) \n',TE)
TEs = (12*60*60)+(18*60); %tidal period converted to seconds
TAE = (HTEam-LTEam)/2;
fprintf('East tidal amplitude = %1.2f m \n',TAE)
%West
HTWam = 1.58; % m time of high water at the West End on October 29rd, 2019
LTWam = -0.091;
% military time
HTWtam = 1029;
LTWtam = 0516;
HTWtpm = 2255;
LTWtpm = 1755;
TW = (HTWtpm-HTWtam);
fprintf('West tidal period = %1.0f (military time) \n',TW)
TWs = (12*60*60)+(26*60); %tidal period converted to seconds
TAW = (HTWam-LTWam)/2;
fprintf('West tidal amplitude = %1.2f m \n',TAW)
fprintf('EAST\n')
LE = TEs*sqrt(g*d);
fprintf('East wavelength = %1.2f m \n',LE)
kE = (2*pi)/LE; %wave number
LoE = (g*TEs^2)/(2*pi);
sigmaE = (2*pi)/TEs;
etaoE = 2*TAE*sin(kE*l);
CoE = LE/TEs; %wave celerity
LW = TWs*sqrt(g*d);
fprintf('West wavelength = %1.2f m \n',LW)
kW = (2*pi)/LW; %wave number
LoW = (g*TWs^2)/(2*pi);
sigmaW = (2*pi)/TWs;
beta = (5*pi)/3;
CoW = LoW/TWs; %wave celerity
etaoW = 2*TAW*sin(kW*(-l));
for i = l:length(t)
for j = l:length(x)
etaE(i,j) = etaoE.*((sin(kE.*(l-x(j))))./(sin(kE.*l))).*cos(t(i)); %surface elevation
uE(i,j) = (etaoE./d).*CoE.*((cos(kE.*(l-x(j))))./sin(kE.*l)).*sin(t(i)); %wave speed
etaW(i,j) = (etaoW.*((sin(kW.*x(j)))./(sin(kW.*l))).*cos(t(i)))+beta; %wave slope
uW(i,j) = -((etaoW./d).*CoW.*((cos(kW.*x(j)))./sin(kW.*l)).*sin(t(i)))+beta; %wave speed
etaT(i,j) = etaE(i,j)+etaW(i,j);
uT(i,j) = uE(i,j)+uW(i,j);
end
end
figure(1)
plot(x,etaT(1,:),'b',x,etaT(2,:),'r',x,etaT(3,:),'g',x,etaT(4,:),'k')
%hold on
%plot ([sb sb], etaT(1,:))
xlabel('l, length of channel (m)')
ylabel('tidal elevation (m)')
title('Tidal Elevation Changes')
legend('t=0','t=pi/2','t=pi','t=3pi/2')
figure(2)
plot(x,uT(1,:),'b',x,uT(2,:),'r',x,uT(3,:),'g',x,uT(4,:),'k')
xlabel('l, length of channel (m)')
ylabel('Current velocity (m/s)')
title('Current velocity over tidal length')
legend('t=0','t=pi/2','t=pi','t=3pi/2')Birgitt O'Connorhttps://nl.mathworks.com/matlabcentral/profile/authors/11454644-birgitt-o-connortag:nl.mathworks.com,2005:Question/4909762019-11-14T00:02:38Z2019-11-14T01:47:23ZWriting a Function CodeI need to write a function that receives a float as input which represents a timestamp in seconds since midnight. It need to return the time in HH:MM AM/PM format but rounded to the nearest 15 minute peroid
Lauren Kinchlahttps://nl.mathworks.com/matlabcentral/profile/authors/16165196-lauren-kinchlatag:nl.mathworks.com,2005:Question/4909882019-11-14T05:00:00Z2019-11-14T01:47:07ZHow can I programmatically extract the line number at which a caught error occurred?How can I programmatically extract the line number at which a caught error occurred?
MathWorks Support Teamhttps://nl.mathworks.com/matlabcentral/profile/authors/4622813-mathworks-support-teamtag:nl.mathworks.com,2005:Question/4909832019-11-14T01:30:03Z2019-11-14T01:45:05ZNumerical Methods - Broyden's Method. Error: Not enough input argumentsHere is the code for broyden's method (found online):
function [xv,it]=broyden(x,f,n,tol)
% Broyden's method for solving a system of n non-linear equations
% in n variables.
%
% Example call: [xv,it]=broyden(x,f,n,tol)
% Requires an initial approximation column vector x. tol is required
% accuracy. User must define function f, for example see page 115.
% xv is the solution vector, parameter it is number of iterations
% taken. WARNING. Method may fail, for example, if initial estimates
% are poor.
%
fr=zeros(n,1); it=0; xv=x;
%Set initial Br
Br=eye(n);
fr=feval(f, xv);
while norm(fr)>tol
it=it+1;
pr=-Br*fr;
tau=1;
xv1=xv+tau*pr; xv=xv1;
oldfr=fr; fr=feval(f,xv);
%Update approximation to Jacobian using Broydens formula
y=fr-oldfr; oldBr=Br;
oyp=oldBr*y-pr; pB=pr'*oldBr;
for i=1:n
for j=1:n
M(i,j)=oyp(i)*pB(j);
end;
end;
Br=oldBr-M./(pr'*oldBr*y);
end;
How I am calling it:
x0 = [-0.5 1.4];
f = @(x,y) [(x+3)*(y^3-7)+18; sin(y*exp(x)-1)];
[xv, it] = broyden(x0, f, 15, 1e-9);
From this, I get the error:
Not enough input arguments.
Error in hw10>@(x,y)[(x+3)*(y^3-7)+18;sin(y*exp(x)-1)]
Error in hw10>broyden (line 55)
fr=feval(f, xv);
Error in hw10 (line 9)
[xv, it] = broyden(x0, f, 15, 1e-9);
I am not sure what the issue is here. The code stated that it worked for n x n non linear system. What am I missing here?
Thank you!Austin Lutterbachhttps://nl.mathworks.com/matlabcentral/profile/authors/16210142-austin-lutterbachtag:nl.mathworks.com,2005:Question/4907582019-11-12T23:23:33Z2019-11-14T01:37:48ZLimit on the change rate of the variable in fmincon functionHi,
In fmincon function, how can I put lower and upper bounds on the change rate of a signal, i.e., ?
Thanks
Mohammadhttps://nl.mathworks.com/matlabcentral/profile/authors/4437557-mohammadtag:nl.mathworks.com,2005:Question/4909842019-11-14T01:35:08Z2019-11-14T01:35:08ZSimulink Design Verifier Dead LogicI used simulink design verifier to check my state machine model. And some dead logics are detected.
Red line is dead logic, data type of input1 and input2 are int16.
Simulink Design Verifier explain that some conditions can only be true or unreadchable such as following.
Could you please explain to me??
galaxyhttps://nl.mathworks.com/matlabcentral/profile/authors/15063927-galaxytag:nl.mathworks.com,2005:Question/4906152019-11-12T09:31:50Z2019-11-14T01:34:04ZRegularization for Non-linear fitting with fitnlm. I'm trying to fit a non-linear model with many possible coefficients using fitnlm. The amount of data i have is limited. When i use polynomial empirical models i tend to you stepwise regression to find put those coefficients that are most important (reduced number of coefficients that fit most of the variance). However with fitnlm or any other function in Matlab for non-linear fitting will fit all coefficients leading to overfitting. Matlab provides the p values for the different coefficients but since it is fitting all coefficients we can't use those p values to drop coefficients out. is there a way to combine regularization techniques for parameter selection with the fitnlm function which uses least squares fitting? Carlos Amadorhttps://nl.mathworks.com/matlabcentral/profile/authors/576065-carlos-amadortag:nl.mathworks.com,2005:Question/4909752019-11-13T23:57:02Z2019-11-14T01:32:40Z185k1*185k MatrixHi everyone, I'd like to build a 185k*185k matrix in matlab but my memory doesn't allow me to do it...What can I do to solve my problem?
Thanks in advanceLuis Sanchohttps://nl.mathworks.com/matlabcentral/profile/authors/16849858-luis-sancho