Answered
sum and average of a vector
A=randi(10,30,1) % Example mean(reshape(A,3,[])) If the length of A is not a multiple of 3 A=randi(10,38,1) n=num...

9 years ago | 0

| accepted

Answered
How to find a certain content with index in cell array by looping
A={4 [] [] [] 5 6 [] [] 7 8 9 10} B=A' idx=~cellfun(@isempty,B) out=B(idx)

9 years ago | 1

| accepted

Answered
How to compare images from 2 folders
X_1 = imread(fullfile(doc1,Inputs1{I1})) %or X_1 = imread([doc1 '\' Inputs1{I1}])

9 years ago | 0

Answered
Automatically populating a vector with the output of a for-loop
nd = q./(q + d - d(s)) - q(s)./(q- d(s))

9 years ago | 0

| accepted

Answered
Multiplying spreadsheet column by variable
A=randi(10,4,3) % Example Cst=10 A=[1;2;3] B=A(:,2)*Cst %Multiply column 2 by constant Cst

9 years ago | 0

| accepted

Answered
displaying a date variable in an email
DATE='23.03.1955' sendmail('XXXXX@gmail.com',Date,'Test message','XXX.jpg');

9 years ago | 1

| accepted

Answered
hello.can any one tell me how can I find 5 lowest values in a vector without replacement?
A=[3 4 5 1 2 7 3 9 0 1 4 5 7 3 0 8] [ii,jj]=sort(A) idx=sort(jj(1:5)) out=A(idx)

9 years ago | 0

Answered
why my matlab13a dont show in desktop? why have i to run matlab using run comand??
find where Matlab is installed then create your own shortcut

9 years ago | 0

Answered
How do I initialize matrix values from an array of indices?
Use sub2ind idx = 1:10:100; ii=sub2ind(size(img),idx,idx) img(ii) = 1;

9 years ago | 1

| accepted

Answered
Out of memory error while using eye function.
To get all information you need type memory

9 years ago | 0

Answered
how could I generate the proper table form of iterations, Nothing wrong in results they are just fine.
F =inline('x^3-2*x-3'); a=1; b=2; nmax=20; Fa=F(a); Fb=F(b); k=0; if Fa*Fb<0 disp('iteration a b (wn)Solution...

9 years ago | 0

Answered
Using symbolic matrix operations correctly?
A is not defined as a symbolic matrix. A=sym('a',5) syms x diff(trace(x*A),x)

9 years ago | 0

Answered
dear all:I have a 6* 3 matrix. I wanna choose 4rows randomly. how can I selecete all array in a rows randomly without replacement?
A=[1 2 3;2 3 5;6 4 1;8 6 0;2 4 1;1 4 7;8 4 2] B=A(randperm(6,4),:)

9 years ago | 0

| accepted

Answered
How to solve a system of equations in the matlab?
for the system A*x=b use x=A\b

9 years ago | 0

Answered
User input file directory
Use uigetdir

9 years ago | 0

Answered
Change step value within a for loop.
for i = [1 6:10] y=i end

9 years ago | 0

Answered
Inputs must be 2-D, or at least one input must be scalar
Maybe you want bsxfun(@times,H1,z1) I guess z1 is a vector

9 years ago | 0

| accepted

Answered
Splitting number from its units
str={'1mcg/kg' '1mcg/kg' '1mcg/kg' '0.7mcg/kg/hr' '0.7mcg/kg/hr' '0.5mcg/kg/hr' '0.5mcg/kg/hr' '0.5mcg/kg/hr'} v1=rege...

9 years ago | 0

Answered
How to bin a simple number array?
A=1:120 [b,c]=histc(A,[21 50 60 100 inf]) out=accumarray(c'+1,(1:numel(c))',[],@(x) {A(x)}) out=out(2:end) celldisp(out)

9 years ago | 0

| accepted

Answered
Assigning variables from command line
You can set any parameter you want, then run your m-file var1=1 % set your variable var1 var2=2 % var2 your_mFile % run ...

9 years ago | 0

Answered
Adding to an array with constraints
A=[0.2 0 0.3 0.1 0.3 0.4 0.0] B=[eps a eps] idx=find(B==0) for k=idx c=max(B(idx-1),B(idx+1)) A(id...

9 years ago | 0

Answered
How to use variables in between GUI function?
your_variable=10 handles.your_variable=your_variable guidata(hObject,handles) To call the variable your_variab...

9 years ago | 3

| accepted

Answered
Array operation inside summing
A=[1 2 3 4 5] B=cumsum(A)

9 years ago | 1

| accepted

Answered
How can I resolve algebraic loops in my Simulink model in Simulink 2015
In the algebraic loop insert a unit delay block

9 years ago | 0

Answered
Indices of a maximum value in a multidimensional matrix.
a=rand(100,16,4,10); %Example [max_value,idx]=max(a(:)) [x,y,z,w]=ind2sub(size(a),idx) If the dimension of a is unknown...

9 years ago | 0

| accepted

Answered
Data type conversion in struct fields
This is not the best way to do but it works. %------Example----------------- TempCoef=rand(1,10) v.obs_c1= 'TempCoef(5)...

9 years ago | 0

Answered
How can I declare a string variable which I can call when loading a filename?
model='Model.mean.dat' load(model);

9 years ago | 0

| accepted

Answered
Percentage of variation?
b = 100*abs(Yav - Ycp)./ Yav

9 years ago | 0

| accepted

Answered
cell2mat of specific coulmns
A=arrayfun(@(x) randi(10,8,3),1:6,'un',0) % ----Example------ B=cell2mat(cellfun(@(x) x(:,3),A,'un',0))

9 years ago | 1

| accepted

Load more