回答済み
Convert Cell to variable name array
A={'sample1' 'sample2' 'sample3'} ; a = array2table(rand(3)); % an example a.Properties.VariableNames=A

6日 前 | 0

| 採用済み

回答済み
Problem with university's licence
Contact your university's IT department.

6日 前 | 1

回答済み
Ode45 iteration issue
[t1,X2]=deal(cell(numel(C1),1)); for k = 1:numel(C1) [t1{k},X2{k}] = ode45(@(t,x)fun(t,x,C1(k),C2(k),C3(k),C4(k)),t0,X01);...

6日 前 | 0

| 採用済み

回答済み
zero for input argument
zeros not zero

6日 前 | 0

| 採用済み

回答済み
How to insert an unknown number of coloumn in a Matrix?
Try this: B=rand(3); % your initial matrix [m,n]=size(B); No_of_Columns=input('No of columns to be inserted') disp...

6日 前 | 0

| 採用済み

回答済み
How can I set a matrix value to equal a non-numeric coordinate?
[a,b]=find(x==3)% I don't see the point of this if your assigning the same value x==3 % is already sufficient and efficient for...

6日 前 | 0

回答済み
how to use two y axis in plot?
doc plotyy

6日 前 | 0

回答済み
accumulate in multiple array
splitapply(@(x) mean(x,2),Temp,findgroups(Day))

6日 前 | 1

| 採用済み

回答済み
Use values of array as indices for different array
D = A(sub2ind(size(A),repmat(C(:),1,size(B,2)),B))

7日 前 | 0

| 採用済み

回答済み
Can you extract an element from an array in the same line as you create the array?
Why not? regexp(s,'\w*','match','once')

7日 前 | 1

回答済み
Problem when using fprintf
Look at hypot() if all(size(a) == size(b)) % change this too fprintf('Error: Input sizes are not equal\n') ...

7日 前 | 0

回答済み
Conditional statement of matrix
n=find(A==k) % no loop is needed if you want to know the instances of the satisfied condition

7日 前 | 0

回答済み
how to load .txt data into a function and use it as variables in matlab function
B % just call it function B % not if the file is input from outside the function then parameterize you function by prov...

7日 前 | 0

| 採用済み

回答済み
Saving all output of for loop
You don't need a loop , this is straight forward just vectorize your code: Note: The other answer doesn‘t show the importance o...

7日 前 | 1

回答済み
Copying index positions to other matrices
B2(sub2ind(size(B),row,column))=NaN Why not directly use logical indexing from *isnan()* ?

7日 前 | 1

| 採用済み

回答済み
deleting all rows from a table that contain a string
T(~all(strcmp(T{:,:},'empty'),2),:)

7日 前 | 0

| 採用済み

回答済み
How to classify vectors based on their value?
idx=sum(C,2)>0; A=C(idx,:) B=C(~idx,:)

7日 前 | 1

| 採用済み

回答済み
I am not able to calculate integrals of any kind. Even the example integrals do not work.
Perhaps you would have created a custom function which don't require any output. You can check that by which integral -all An...

7日 前 | 1

| 採用済み

回答済み
Multiplication of rows in a single column
x = prod(A)

8日 前 | 0

回答済み
Save arrays in a structure
doc cell2struct

8日 前 | 0

| 採用済み

回答済み
If the integral decomposition solution is not obtained, what integral method can be used to get the closest value?
[d a z d a0 a1 a2 a3 a4 alpha0 alpha1 alpha2 alpha3 alpha4 rho hgang phi]=deal(1); % if all the value except the r are 1 syms r...

8日 前 | 0

| 採用済み

回答済み
matlab function "solve" couldn't solve correctly
fsolve(matlabFunction(g-x),[-1,2]) % you can also use vpasolve() with random set to true in a loop to see the possibilities

8日 前 | 0

| 採用済み

質問


Why do I get .txt extension eventhough it isn’t?
Whenever I download a .mat file from this forum I get .txt extension appended at the ended. Why is it so ?

8日 前 | 1 件の回答 | 0

1

回答

回答済み
Shorten code for a function
m=cell(5,1); for k=1:5 m{k}=fnP(result,k); end

8日 前 | 0

| 採用済み

回答済み
How can I transform two values separted by _ of one colum in two columns?
s='78.5888_2.027' str2double(regexp(s,'\d+[\.?]\d*','match'))

8日 前 | 0

回答済み
‘’fprintf‘’ cannot be used in a loop?
fprintf('equation%d=%s',i,char(x^2+y^2))

8日 前 | 0

| 採用済み

回答済み
Documentation about multi-line array (matrix) definition?
https://in.mathworks.com/help/matlab/matlab_prog/matlab-operators-and-special-characters.html

8日 前 | 1

| 採用済み

回答済み
How to assign values to 100 by 2 matrix?
By the looks of the question probably you want: % if you want first columns with 2 and the other as 3 then ones(100,2).*[2,3] ...

8日 前 | 1

| 採用済み

回答済み
iimage not showing in ginput()
imshow()

8日 前 | 0

Load more