Answered
saveas: problems with axes when saving a figure as .fig
Use <http://www.mathworks.com/help/matlab/ref/hgsave.html hgsave> and hgload function

13 years ago | 0

| accepted

Answered
cellfun can not combines the outputs in arrays, even the outputs have the same size?
cellfun(@(x) x == 0, acell ,'un',0)

13 years ago | 1

Answered
How to calculate mean of a cell which contains numbers and empty string?
To use cell2mat(A), all element of A should be the same class

13 years ago | 0

Answered
numeric array to cell array
cycles=reshape(stress,2,[]) %you can also create cell array out=arrayfun(@(x) cycles(:,x),1:size(cycles,2),'un',0)

13 years ago | 0

| accepted

Answered
Keep only elements that appear multiple times
A=[1 2 1 1;1 2 3 1;3 3 3 3;3 0 0 1]; B=unique(A(:)); A(ismember(A(:),B(histc(A(:),B)<3)))=0

13 years ago | 0

Answered
dlmread not working as expected...
12:54:00 is double because it represent an empty array starting from 12 to 00 with step=54. type a=12:54:00 I suggest ...

13 years ago | 0

| accepted

Answered
Seperating vectors when reaching a threshold value
A{1}=[1; 3; 4; 6; 1; 2; 4; 3; 5; 2; 1; 4; 2; 4]; A{2}=[3; 5; 7; 4; 9; 1; 5; 6; 8; 9; 6; 2; 4; 1]; a=cumsum(A{2}); m=max(a);...

13 years ago | 0

Answered
how to do discrete laplace transform (like fft) in matlab ?
The z-transform is not the discrete Laplace transform, also the z transform of a discrete signal is a continuous function. The z...

13 years ago | 0

Answered
scaling the colorbar of the plot
set(gca,'ylim',[min_yval max_yval]), %for y axis

13 years ago | 0

| accepted

Answered
generating zeros and ones with equal probability
rand(1,4)>.5 are rand(1,4)<0.5 the same, because rand(1,n) will generate approximately n/2 numbers <0.5 and n/2 numbers >0.5, ...

13 years ago | 2

| accepted

Answered
How to generate random accelerometer signal in SIMULINK
You can use <http://www.mathworks.com/help/simulink/slref/bandlimitedwhitenoise.html Band-Limited White Noise> block

13 years ago | 0

Answered
Store a particular set points in a new cell array.
A=[32.5;25.2;25.91;25.92;16.52;16.7;17;17.45]; B=fix(A+0.5); C=unique(B,'stable') out=cell(numel(C),1); for k=1:numel(C) ...

13 years ago | 0

Answered
Store a particular set points in a new cell array.
A=[32.5;25.8;25.91;25.92;16.52;16.7]; out{1}=A(1); out{2)=A(2:4); out{3}=A(5:6);

13 years ago | 0

Answered
How to add a matrix A to another matrix B with a different size and it should maintain rows of B which do not have the first two elements equal to the first two elements of a row in matrix A?
for k=1:size(B,1) ii=find(ismember(A(:,1:2),B(k,1:2),'rows'),1); if ~isempty(ii) B(k,:)=A(ii,:); end ...

13 years ago | 0

Answered
How do I delete empty cells in rows of a cell array?
A={['a'] ['b'] [ ] [ ] ['c'] ['d'] [ ] ['e'] [ ] [ ]} idx=not(cellfun(@isempty,A)) out=arrayfun(@(x) cell2mat(A(x,idx(x,:))...

13 years ago | 0

| accepted

Answered
Enter data into GUI table
It should be set(handles.table_handle, 'Data', dataMatrix)

13 years ago | 0

| accepted

Answered
How do you generate data at different sampling rates?
Define your time vector ts1=0.1; ts2=0.01; t1=0:ts1:10*ts1; t2=max(t1)+ts2:ts2:max(t1)+10*ts2; t=[t1 t2] % T...

13 years ago | 0

Answered
How randomly choose pairs of elements from a squared matrix and put them in an other matrix?
m=5 n=numel(A) ii=0 idx=[]; while ii<m id=setdiff(randperm(16),idx,'stable'); [ii1,jj1]=ind2sub(size(A),id(1)); ...

13 years ago | 0

Answered
How randomly choose pairs of elements from a squared matrix and put them in an other matrix?
m=5 n=numel(A) ii=0 while ii<m id=randperm(16); [ii1,jj1]=ind2sub(size(A),id(1)); [ii2,jj2]=ind2sub(size(A),...

13 years ago | 0

| accepted

Answered
How do I add a matrix to another matrix with different sizes?
B(A(:,1),:)=A

13 years ago | 0

Answered
How do I add two columns to a matrix in ascending order?
x=[1 2 3] y=[4 5 6] x1=repmat(x,numel(y),1) out=[x1(:) repmat(y',numel(x),1)]

13 years ago | 1

| accepted

Answered
How can I use different array names in a loop?
for i=1:4 evalin('base',sprintf('a_%d_b(:,1)=a_%d_b(:,1)+7',i,i)) end %or for i=1:4 data=7 evalin('base...

13 years ago | 0

| accepted

Answered
Undefined variable error while using for loop.
i=1; evalin('base',sprintf('X_%d=10',i))

13 years ago | 0

| accepted

Answered
compare 2 matrix with different dimensions
A=[1 10 20;2 100 200;3 1000 2000;4 44 55] B=[11 20;100 200;1 4;44 55 ] out=A(~any(A(:,2:3)-B,2),1)

13 years ago | 0

Answered
Split a string with "no delimiters"
a='yellow08car' b=regexp(a,'\d*','split') out=b{2} %or a='yellow08car.data' b=regexp(a,'[\d.]','split') out=b{end-...

13 years ago | 0

| accepted

Answered
How do you declare a symbolic function of time as a real variable
syms t x1=sin(t) % Example

13 years ago | 0

Answered
generate a random number of 128bits
A=randi(2,1,128)-1 %or A=num2str(randi(2,1,128)-1); A(strfind(A,' '))=[]

13 years ago | 0

Answered
How to add a string output to this function?
function [op,op1] = operation( A,B ) X=[A+B; A-B; A/B; A*B; B-A; B/A;]; o={'plus','minus','div','prod','iminus','idiv'} ii=...

13 years ago | 0

| accepted

Answered
Using regexp to capture parts of a filename
x='Exp000_DD2CM000_PN000_block1_predecision' a=regexp(x,'_','split') experimentName = a{2} participantName = a{3} block=re...

13 years ago | 2

| accepted

Load more