Answered
Take elements from a cell variable to other based on a condition
ic5=find(cellfun(@isempty,A(:,5) )) for k=ic5' ib1=find(cell2mat(B(:,1))==A{k,1}) if ~isempty(ib1) A(k,5)=B(ib...

12 years ago | 1

| accepted

Answered
index info for CAT
index=reshape(cumsum([1 numel(x1)-1 1 numel(x2)-1 1 numel(x3)-1]),2,[])'

12 years ago | 0

| accepted

Answered
mutual array between two matrix
Z=[5,2,1,6,8,3,4,7]; a=[2 7] Z(ismember(Z,a))=[]

12 years ago | 0

Answered
how to sort table in R2013a
Use sortrows

12 years ago | 0

Answered
Find unique combinations of double and character elements
A={1994 'AACE' 2071 1994 'AACE' 30677 1994 'AAC' 1541 1994 'AAC' 2027 1994 'AAC' 7843}; c12=cellfun(@(x,y) [num2...

12 years ago | 1

| accepted

Answered
Max()-function and multiple dimensions
*Edit* A=rand(10,10,10,10,10); [max_value,idx]=max(A(:)); q=['[' sprintf('x%d,',1:ndims(A))]; q(end)=']'; eval([q '=i...

12 years ago | 0

Answered
While Loops - TextBook Example
You can check how many times your while loop runs ires=2; k=0; while ires<=200 k=k+1 ires=ires^2; end In you...

12 years ago | 1

Answered
increase the font size of my caption in X axis?
xlabel('your_xlabel','fontsize',12)

12 years ago | 0

Answered
How to check if file name has a certain ending?
d=dir('*.*') e={d.name}' f=e(~cellfun(@isdir,e)) ii=regexp(f,'\.+','match') jj=find(cellfun(@isempty ,ii)) g1=f(jj) g2=s...

12 years ago | 1

Answered
Track changes in the rows to get a new variable in Matlab
*Edit2* change2=[2009 1 42 2010 1 42 2011 1 559 1995 12 100 2000 12 100 2000 12 111 2000 12 111 2000 12 141 200...

12 years ago | 1

| accepted

Answered
creating matrix by iteration 2
v=1:4; a=3; out=sort([v a])

12 years ago | 0

| accepted

Answered
Extract element from column vector with condition
*Edit* P=[ 0; 212; 111; 190; 0; 223; 123; 200; 189; 219; 0; 190; 175; 202; 167; 181 ] ii=strfind(P'~=0,[0 1]) idx=ii([dif...

12 years ago | 0

Answered
Error when computing the mean in Matlab
mean([Num_Firm_An{:,3}])

12 years ago | 1

| accepted

Answered
mmyyy date to matlab date
d=[199001, 199002, 199003 ] a=arrayfun(@(x) datenum(num2str(x),'yyyymm'),d)

12 years ago | 0

Answered
save dataset in a specific exel sheet
num = xlsread(filename,sheet)

12 years ago | 0

| accepted

Answered
How to compute frequency of rows for submatrices?
With one for loop D=[1 0 1 1; 0 1 1 1;1 1 0 1; 1 1 0 1;1 1 0 1; 0 1 1 1; 1 1 1 0; 0 1 1 1; 1 0 1 1; 1 0 1 1; 1 0 1 1; 1 1 0...

12 years ago | 0

Answered
How to compute frequency of rows for submatrices?
D=[1 0 1 1; 0 1 1 1;1 1 0 1; 1 1 0 1;1 1 0 1; 0 1 1 1; 1 1 1 0; 0 1 1 1; 1 0 1 1; 1 0 1 1; 1 0 1 1; 1 1 0 0] a=permute(reshap...

12 years ago | 0

| accepted

Answered
chose a subplot (1 of 9)
set(your_handle,'xdata',0:.1:2,'ydata',sin(0:0.1:2))

12 years ago | 1

| accepted

Answered
3rd derivative of position
dt=t(2)-t(1) dy=gradient(y,dt) dy2=gradient(dy,dt) dy3=gradient(dy2,dt) t=t(1:end-3) dy3=dy3(1:end-3) plot(t,dy3) %or...

12 years ago | 1

Answered
More line objects returned by findobj() than there are lines
Try this to understand set(hlegline(1),'marker','*') set(hlegline(1),'marker','o') set(hlegline(3),'marker','o') set...

12 years ago | 1

| accepted

Answered
get title of subplot back
close x=repmat((1:10)',1,9); y=rand(10,9); for k=1:9 subplot(3,3,k); plot(x(:,k),y(:,k)); title(sprintf('tit...

12 years ago | 0

| accepted

Answered
How to read a .dat file, containing binary data?
fid= fopen('your_file.dat'); data=fread(fid); fclose(fid);

12 years ago | 1

Answered
how to superimpose three matrix
out=max(A,B) out=max(out,C)

12 years ago | 0

| accepted

Answered
how to round up and down?
sign(A).*ceil(abs(A))

12 years ago | 0

| accepted

Answered
For loop with the loop variable equal to a matrix
Check what your code is doing M = [1 3 -2; 7 -5 1] temp = 0; for k = M 'k=',k % Look at the value of k temp =...

12 years ago | 0

Answered
Help finding duplicate values in an array of matrices?
Maybe you want this A={[1 2;1 2;0 4;7 8 ;1 2;7 8],[0 1;0 2;1 4;1 4;0 2;0 2]} out=cellfun(@(x) unique(x,'rows'),A,'un',0)...

12 years ago | 0

Answered
How can I select specific text files ?
a={'Mod1-A-00k.txt', 'Mod1-A-10k.txt', 'Mod1-A-30k.txt', 'Mod1-B-00k.txt', 'Mod1-B-10k.txt', 'Mod1-B-30k.txt'} idx=~cellfun(@...

12 years ago | 0

| accepted

Answered
Matlab - verify if a string have any number
str='scramble3' idx=~isempty(regexp(str,'\d','match')) %or idx=any(ismember(str,'0':'9'))

12 years ago | 0

Answered
Add lines to plot
Use hold on

12 years ago | 1

Answered
how to compare two matrix by graph?
R1=sin(0:0.1:10) R2=R1+1e-12*rand(1,numel(R1)) er=R2-R1 plot(er)

12 years ago | 0

Load more