답변 있음
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년 초과 전 | 0

| 수락됨

답변 있음
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년 초과 전 | 1

| 수락됨

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

9년 초과 전 | 0

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

9년 초과 전 | 0

| 수락됨

답변 있음
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년 초과 전 | 0

| 수락됨

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

9년 초과 전 | 1

| 수락됨

답변 있음
My instructor assigned us to do a snake(n) function. For example snake(3) then the display must be 1 2 3 on the first row, 6 5 4 on the 2nd and 7 8 9 on the third and last row. How to do this? Pls help
You can create [1 2 3 4 5 6 7 8 9] then use a for loop and fliplr function to flip 2nd 4th ... rows

9년 초과 전 | 0

답변 있음
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년 초과 전 | 0

답변 있음
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년 초과 전 | 0

답변 있음
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;

거의 10년 전 | 1

| 수락됨

답변 있음
Out of memory error while using eye function.
To get all information you need type memory

거의 10년 전 | 0

답변 있음
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...

거의 10년 전 | 0

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

거의 10년 전 | 0

답변 있음
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),:)

거의 10년 전 | 0

| 수락됨

답변 있음
How to solve a system of equations in the matlab?
for the system A*x=b use x=A\b

거의 10년 전 | 0

답변 있음
User input file directory
Use uigetdir

거의 10년 전 | 0

답변 있음
Change step value within a for loop.
for i = [1 6:10] y=i end

거의 10년 전 | 0

답변 있음
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

거의 10년 전 | 0

| 수락됨

답변 있음
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...

거의 10년 전 | 0

답변 있음
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)

거의 10년 전 | 0

| 수락됨

답변 있음
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 ...

거의 10년 전 | 0

답변 있음
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...

거의 10년 전 | 0

답변 있음
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...

거의 10년 전 | 3

| 수락됨

답변 있음
Array operation inside summing
A=[1 2 3 4 5] B=cumsum(A)

거의 10년 전 | 1

| 수락됨

답변 있음
How can I resolve algebraic loops in my Simulink model in Simulink 2015
In the algebraic loop insert a unit delay block

거의 10년 전 | 0

답변 있음
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...

거의 10년 전 | 0

| 수락됨

답변 있음
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)...

거의 10년 전 | 0

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

거의 10년 전 | 0

| 수락됨

답변 있음
Percentage of variation?
b = 100*abs(Yav - Ycp)./ Yav

거의 10년 전 | 0

| 수락됨

답변 있음
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))

거의 10년 전 | 1

| 수락됨

더 보기