Answered
How to put a list of different arrays, one below another, to create a new array ?
*Edit* data=[]; for i=1:21 a = handles.models(i).gmm; b = a.mu'; SV = b(:)'; data=[data;SV] end

13 years ago | 0

| accepted

Answered
How to sort the order given by 'dir' command ???
file={'test_base1','test_base10','test_base2'} [idx,idx]=sort(cellfun(@(x) str2num(char(regexp(x,'\d*','match'))),file)) new...

13 years ago | 0

| accepted

Answered
matlab 2nd min question
A=[1 0 2;3 4 5;0 0 4] b=A(:); b=b(b~=0) val=min(b) %or B=A B(B==0)=inf; [min_val,idx]=min(B(:))

13 years ago | 0

Answered
how to write in the if statement or other loop statement in matlab
<http://www.mathworks.com/help/matlab/ref/if.html if/elseif/else> <http://www.mathworks.com/help/matlab/ref/while.html while>...

13 years ago | 0

Answered
Line of code instead of "ans"
f=@(x,s,ii) [s sprintf('(%d)=',ii) num2str(x(ii))] disp(f(A,'A',2))

13 years ago | 0

| accepted

Answered
Question about assigning value in a matrix.
A=zeros(4); a=[1,2; 2,3; 3,2; 4,1]; idx= sub2ind(size(A),a(:,1),a(:,2)); A(idx)=1

13 years ago | 0

Answered
Indexing of fresh array in one line without intermediate variable.
Look at <http://www.mathworks.com/help/matlab/ref/cellfun.html cellfun> <http://www.mathworks.com/help/matlab/ref/arrayfun...

13 years ago | 0

Answered
how to change the switch between two condition?
You can use a <http://www.mathworks.com/help/simulink/slref/switch.html switch block> The second port of your switch block sh...

13 years ago | 0

Answered
Undefined function 'tf' for input arguments of type 'double'. how i can rectify this error in matlab 2012b
Check if you have a control system toolbox, which tf %or ver

13 years ago | 0

Answered
Matlab thinks 1.0000... is not 1
Look at <http://matlab.wikia.com/wiki/FAQ#Why_is_0.3_-_0.2_-_0.1_.28or_similar.29_not_equal_to_zero.3F FAQ>

13 years ago | 0

| accepted

Answered
XLSWRITE - into same folder location as M file
You should specify the folder when using xlswrite xlswrite('yourolder/yourfile.xls',data)

13 years ago | 1

Answered
how do i plot date in x axis
dat=datenum('17/11/2007','dd/mm/yyyy'):datenum('11/03/2008','dd/mm/yyyy'); y=cos(0.1*(1:numel(dat))); % Example plot(dat,y)...

13 years ago | 2

Answered
What is the best way to convert a vector of integers to binary in simulink?
You can use Matlab function block with this code function b=decimal2binary(n,nB) %n your number %nB number of bits, =16...

13 years ago | 0

Answered
adjust for matrix input
Use |sum(XX,2)| instead of |sum(XX)| p_t2=rand(2,1000); pt2=rand(2,40); JJ=[] for z=1:40 for v=1:25 XX=p...

13 years ago | 0

Answered
Help with if-else statement?
fic=dir('current_path/*.mat') f={fic.name} idx=cellfun(@(x) ~isempty(regexp(x,'201305')),f) for k=1:numel(idx) a1=full...

13 years ago | 0

Answered
error when fixing matrik size
A=[1 2 3 ; 4 5 6] the size of A is 2x3, you will get an error if you write A(4,1)

13 years ago | 0

| accepted

Answered
How to evaluate the value of Symbolic Expressions
f=@(a) sin(a); g=@(b) exp(b); disp(f(2)); disp(g(4));

13 years ago | 1

| accepted

Answered
How to plot a bar on a bar in a bar graph
x=1:2; y=[10 12]; perc=[25 50]; new_y=[y.*perc/100]; bar(x,y,'b'), hold on, bar(x,new_y,'b') alpha(0.2) hold off

13 years ago | 0

| accepted

Answered
create sub arrays from a array
*Edit* a=[4,4,4,3.5,3,3.1,3.2,4,3.5]; idx=a>=3.4; idx2=sort([strfind(idx,[true false]) strfind(idx,[false,true]) nu...

13 years ago | 0

| accepted

Answered
Problem with answer of interp1
Let us sort your vector [P1,idx]=sort(P_vect ) Y1=Y_vect(idx) Y=interp1(P1, Y1, P) % in this case P is between the sec...

13 years ago | 0

Answered
A transfer function out of a complex function
If L is your impulse response, Maybe L is %L(t)=0.1(4exp(-t)-4t+6)u(t) % u(t) is a step function The transfer functio...

13 years ago | 1

Answered
How can I convert a number into a text string for their corresponding word in english ?
Try this FEX <http://www.mathworks.com/matlabcentral/fileexchange/37645-somme-in-letter/content/num2let.m>

13 years ago | 0

Answered
How to take the value of the array
cell2mat(wj1)

13 years ago | 0

Answered
Setting Simulink Time Step from an external File
set_param('untitled','Start Time','100') set_param('untitled','Stop Time','1000')

13 years ago | 0

Answered
how do I import date from .xls where cell contains numbers and letters
s={'10-1-2005 0:05 MDT';'11-1-2005 0:05 MDT'} s=cellfun(@(x) datenum(strrep(x,'MDT','')),s) dat=datestr(s,'dd-mm-yyyy HH:MM'...

13 years ago | 0

Answered
How to manipulate arrays based on the values of the elements in those arrays?
n=numel(bb) cc=zeros(1,n) for k=1:n [~,idx]=min(abs(aa-bb(k))); cc(k)=aa(idx); aa(idx)=[]; end

13 years ago | 0

Answered
How to resize a matrix repeating the original values N times...
N=3 out=cell2mat(arrayfun(@(x) ones(N)*x,A,'un',false)) Or A=[1 2 3;4 5 6;7 8 9] n=3 m=size(A,1)*n out=r...

13 years ago | 0

Answered
Build 3D Plot from video
To read your video video= VideoReader('yourfilename.mpg') vidFrames = read(video); frame1=vidFrames(:,:,:,1) Can you e...

13 years ago | 0

Answered
what is wrong with my 'For' loop
clc close all v=[0.2 0.5]; d=0.1; density=1000; w=0.446; t=0.2; rr=30.494*v.^5-86.479*v.^4+89.045*v.^3-34.023*v.^2+...

13 years ago | 0

Load more