Answered
Randperm generating the same sequence of permutation
for k=1:3 out{k}=randperm(10,5) end celldisp(out)

11 years ago | 1

Answered
How to plot multiple graphs in multiple rows in one grap
subplot (2,1,1) plot (x1,y1, x2,y2,x3,y3) subplot (2,1,2) plot (x4,y4,x5,y5, x6,y6)

11 years ago | 0

| accepted

Answered
subtracting a value from a vector
Maybe you mean: how to remove the element in B from A A=[3,4,5,6,7,8,9,2,4,3] B=3 out=setdiff(A,B)

11 years ago | 0

| accepted

Answered
how to add row and column label to a matrix and make it as a dataset?
df =randi(10,100,1) a=reshape(df,50,[]) out=mat2dataset(a)

11 years ago | 0

Answered
Removing certain lines in a text file by setting a restriction
fid=fopen('fic.txt') l=fgetl(fid); k=1; while ischar(l) r{k}=l; k=k+1 l=fgetl(fid); end kk=0 for k=1:nume...

11 years ago | 0

Answered
Select data from a date range
d=datenum('1/31/2010'):datenum('12/31/15') % Example data=randi(9,numel(d),1)' d1=datenum('1/31/2012') d2=datenum('12/31/20...

11 years ago | 0

Answered
How make separate plots of one timeseries
If the size of y_ss is nx3 sim('HW2_P5model') time=y_ss.Time y1=y_ss(:,1) y2=y_ss(:,2) y3=y_ss(:,3) plot(t,y1,t,y2,t,y...

11 years ago | 0

Answered
multi level indexing acess
v=[1 2 3 4] v(2) If you want one line, then just write v=2

11 years ago | 0

Answered
pls solve this problem. one of my advisor said this problem is related to neumerical analysis.this problem is from the last pat page
In your expression exp(6.53*10^18) is infinite (this number is not handled by Matlab)

11 years ago | 0

| accepted

Answered
how to get the time long after decimal point
it's format long, with one g format long t=clock; t1 = t([5,6])

11 years ago | 0

Answered
Import data from workspace
Use the <http://www.mathworks.com/help/simulink/slref/fromworkspace.html From Workspace block>

11 years ago | 0

| accepted

Answered
find the values not existing in this array given below and save it?
p1=[8 11 13 6 18 16 10 5 3 4]; p2=[1 7 2 6 16 12 4 10 9 8] a=setdiff(1:20,[p1,p2])

11 years ago | 0

| accepted

Answered
how to divide a rectangle into 5 equal parts???
n=5 % number of parts h=rectangle('Position',[800,900,500,1000]); pos=get(h,'position') a=pos(3)/n for k=1:n hol...

11 years ago | 0

Answered
How to convert cell array to structure array
a1={'AA','AA','AA','BB','BB','BB','BB'}'; a2={'35000','96000','88000','33000','44000','8000','18000'}'; a3={'1a','1b','1c','...

11 years ago | 2

| accepted

Answered
Handling character array rather than cell
data{:}

11 years ago | 0

| accepted

Answered
random numbers in between two ranges
a=20 b=50 n=1000 v=a+(b-a)*rand(1,n)

11 years ago | 0

| accepted

Answered
Write as a MATLAB program
%------------your parameters----- kp=10 t1=1 t2=1 a=1 w=1 %---your transfer fuction----------- N=kp D=[t1*t2 t1+t2 1] ...

11 years ago | 0

| accepted

Answered
How can I change the sampling frequency of audio signal?
[y,fs] = audioread(filename); %change the sampling rate fs2= 2*fs/3; audiowrite(filename,y,fs2) %Read the data back into M...

11 years ago | 0

Answered
How to add additional field in the structure from already formed cell array?
patient(1).name = 'John Doe'; patient(1).billing = 127.00; patient(2).name = 'Ann Lane'; patient(2).billing = 28.50; name=...

11 years ago | 0

| accepted

Answered
how to write If-else statement in GUI Matlab?
% --- Executes on button press in sumbutton. function sumbutton_Callback(hObject, eventdata, handles) % hObject handle t...

11 years ago | 1

| accepted

Answered
How can I use for loop twice
Look at this part of your code for j=1:360 end It's not correct, and even it's corrected for j=1:360 e...

11 years ago | 0

| accepted

Answered
how to access value from gui to simulink subsystem for mask resistor ????
To get the reals names of your parameters type get_param('MyModel/MySubsystem/MyBlock','DialogParameters') The name of t...

11 years ago | 0

| accepted

Answered
finding upper & lower limit
x = -10:0.1:10; f1 = trapmf(x,[-2 0 0 2]); [a,ix]=max(f1) x1=x(1:ix-1) y1=f1(1:ix-1) x2=x(ix+1:end) y2=f1(ix+1:end) plo...

11 years ago | 0

Answered
What´s Continue entering statement.?
You missed *end* at the end of your *if* statement

11 years ago | 0

Answered
Select rows and columns
A(1:8,1:3) Example A=randi(9,10,5) out=A(1:8,1:3) Read this <http://www.mathworks.com/help/matlab/learn_matlab/arr...

11 years ago | 2

| accepted

Answered
Sort 1 colum and other colums sort correspondingly
Use sortrows v=[{'a' 'b' 'zygz' 'c'};num2cell(randi(4,10,4))] % Example M=v(2:end,:) out=sortrows(M,3)

11 years ago | 0

| accepted

Answered
Export a matrix to a txt file
for k=1:size(N,1) str{k,1}=[ '''' char(N(k,1)) ' ' char(N(k,2)) ' ' char(N(k,3)) '''' ] end

11 years ago | 0

Answered
managing year and months
Use cell arrays instead of creating several variables. M = [2015 1 5 ; 2015 1 6 ; 2015 2 6 ; 2014 3 6 ]; v=M(:,1:2); [ii,...

11 years ago | 0

Answered
Removing certain lines of text from a cell array
v={'esoabcd';'abcgd';'ehdf';'esoez'} out=v(cellfun(@isempty,regexp(v,'(?<=eso).+')))

11 years ago | 0

Answered
How to read a .txt file?
fid=fopen('fic.txt') l=fgetl(fid) k=1 while ischar(l) r{k}=l l=fgetl(fid) k=k+1; end fclose(fid); ii=find...

11 years ago | 1

| accepted

Load more