Answered
Using the "find" command with arrays of cells
find(ismember(chanels,'B3'))

11 years ago | 0

| accepted

Answered
How to stack data read and images and plot in 3D ?
out=reshape(cell2mat(images),250,250,[]);

11 years ago | 0

| accepted

Answered
How can I print names of files or folders contained in a specific folder in first (( COLUMN A ) in excel sheet?
for folder = 1:length(srcFolders) data{folder,1} = fullfile('D:',srcFolders(folder).name); end xlswrite('xlsFile', data...

11 years ago | 1

| accepted

Answered
More X ticks for subplots
Look at this example %---------Example--------------- t=0:0.1:10; y=[sin(t);cos(t);t.^2]; for k=1:3 subplot(1,3,k...

11 years ago | 0

Answered
How can I split my data into categories
a={'AN1','ASA','AND','ANL','ABB','ACD','ACH','ACK','AYT','ALD'} b={'stock','stock','stock','stock','bond','bond','bond','bill...

11 years ago | 0

| accepted

Answered
Replacing 1's in a vector 'a' with elements of another vector 'b' where a and b are not equal?
a=[nan nan 1 1 nan 1 nan 1 1 1 1] b=[2 3 4 5 6 7 8] idx=a==1 a(idx)=b(1:sum(idx))

11 years ago | 0

Answered
How can I change the elements of a matrix in new one?
A=rand(4) [m,n]=size(A); B=[] for ii = 1:m I = (ii-1)*2; for jj=1:n J = (jj-1)*2 + 0.5; if(A(ii...

11 years ago | 0

| accepted

Answered
How to find consecutive values above a certain threshold?
A=[0 1 2 5 7 8 13 17 28 11 6 0 2 1 40 55 88 47 4 44 ] idx=A>12; ii1=strfind([0 idx 0],[0 1]); ii2=strfind([0 idx 0],[1 0]...

11 years ago | 2

| accepted

Answered
Calculate mean from daily to monthly values.
dn=datenum('01-01-2008','dd-mm-yyyy'):datenum('31-12-2014','dd-mm-yyyy') swh=randi(10,numel(dn),1) [y,m,d] = datevec(dn); a...

11 years ago | 2

| accepted

Answered
Trying to sort a table by entry in specific column
A=[1 2 3;0 4 5;1 8 7;1 14 10;0 1 2;4 1 2;1 2 33] idx=A(:,1)==1 out=mean(A(idx,[2 3]),2)

11 years ago | 0

Answered
How to automatically delete empty cell arrays generated from a script
v={2 3 [] 5} idx=cellfun(@isempty,v) v(idx)=[]

11 years ago | 1

| accepted

Answered
Putting similar named variables into one vector or structure
v={'C_100','aze','C_200'} C=regexp (v,'C_\d+','match') idx=~cellfun (@isempty,C) outc=C (idx)

11 years ago | 0

Answered
Choosing data from an array using a binary array
You can also use Z (logical (binary))

11 years ago | 1

Answered
how to convert a given matrix in an array while reading all the elements of matrix in a particular order.
A=[1 2 3 4 5 6; 7 8 9 10 11 12; 13 14 15 16 17 18; 19 20 21 22 23 24] q=spdiags(rot90(A)) q(:,2:2:end)=flipud(q(:,2:2:en...

11 years ago | 1

Answered
Why do I get a vector of zeros?
A=[1 2 3] B=[4 5 6] out=A./B Where is the problem with this division?

11 years ago | 0

| accepted

Answered
How to assign proper index within a for loop?
You can't do TA((r,c,i) = A((find(A2 == b(i))),:) Because find(A2 == b(i)) will return different sizes. but you can use ...

11 years ago | 0

Answered
Replace zeros with consecutive numbers in a vectors
This takes in account all zeros A=[1 ;2; 7;0; 0 ;4;8;0;6;7;18;0;0;0;12;0 ;0 ;13] A=A' idx1=A==0 ; ii1=strfind([0 idx1 0]...

11 years ago | 0

Answered
How to write a for loop with break condition... (reimann sum)
Use while loop sum=0; sum2=0; s1=1; while s1>=0.01 p=(((-1)^(n+1)+1)/n)*sin((n*pi*x)/L)*((sinh((n*pi*y/L))/(sinh((n...

11 years ago | 0

Answered
Copy particular column from an array
Y(1:3,2) Read the documentation <http://www.mathworks.com/company/newsletters/articles/matrix-indexing-in-matlab.html>

11 years ago | 2

Answered
MATLAB from command line - Cannot find script in the current direcoty
Don't add the extension. Just type test

11 years ago | 0

| accepted

Answered
I want to draw a graphic simulation of a robot using matlab. need to plot the lines in place of arm and then show the movement
Use <http://www.mathworks.com/videos/series/getting-started-with-simulink-3d-animation-94454.html Simulink 3D animation>

11 years ago | 0

Answered
Matlab command history question
<http://www.mathworks.com/matlabcentral/answers/97504-how-can-i-access-the-saved-command-history-in-matlab> You can find the ...

11 years ago | 0

Answered
How can I pull a string from a file to GUI
Use <http://www.mathworks.com/help/matlab/ref/textscan.html textscan> to read your text from your text file fid=fopen('file...

11 years ago | 1

| accepted

Answered
Reading numbers from a text file
*Edit* fid=fopen('file.txt') a=textscan(fid,'%s') fclose(fid) c=regexp(a{:},'\<(+|-|\.|\d)\d*(\.)?(\d+)?','match') f=c(...

11 years ago | 0

| accepted

Answered
how to resolve "Conversion to cell from double is not possible." error
a=cell(1,2); for i=1:2 a(i)=mat2cell(zeros(8,8,2),8,8,2); a{i}(:,:,1)=randi(8,8); end

11 years ago | 4

| accepted

Answered
How to read numbers from this mat file ?
a=regexpi(text,'(?<==)[-+\d]+(.)?([\d-+ث]+)?','match','once') id=~cellfun(@isempty,a(:,1)) b=a(id) out=str2double(b)

11 years ago | 0

| accepted

Answered
Extract numbers out of a .mat file that has both characters and numbers
a=regexp(text,'(?<==)\d+(.)?(\d+)?','match','once') id=~cellfun(@isempty,a(:,1)) a=str2double(a(id))

11 years ago | 0

| accepted

Answered
Import text files with character and numeric data
s=importdata('file.txt') data=s.data text=s.textdata colheaders=s.colheaders

11 years ago | 1

| accepted

Load more