Answered
Cell Array to table
doc cell2table

7 years ago | 1

Answered
extracting a particular element from a matrix
[Value,Index]=max(A+B)

7 years ago | 0

Answered
Plotting Results of a While Loop
h = 0 : 10 : 11000; T = 15.04 - 0.00649 * h; P = 101.29 * ((T + 273.15)./288.08).^(5.256); rho = P./...

7 years ago | 2

Answered
Hi. I am a complete novice at matlab and have been asked to create a 10x10 matrix in as few steps as possible. The first row has to be from 1:10, the second line from 2:11 and so on. How can I create this using repmat?
Honestly Fangjun Jiang's answer is the way I would do it but according to your question "How can I create this using repmat?" Wh...

7 years ago | 0

Answered
i need to factor a symbolic polynomial for example x^2-1
Just define x as symbolic variable and use factor() for your polynomial.

7 years ago | 0

| accepted

Answered
find length NaN segments
https://www.mathworks.com/matlabcentral/answers/444595-count-the-occurence-of-a-number-in-between-other-numbers - replace the fi...

7 years ago | 1

| accepted

Answered
変数の作成について
I strongly don’t recommend using eval here in this situation ,https://www.mathworks.com/help/matlab/matlab_prog/generate-field-n...

7 years ago | 2

Answered
Element wise multiplication .* rounding problem
Second John D’Erricos answer as a workaround if you have symbolic math toolbox: P=sym(sin(5)); % just alter your line to this

7 years ago | 1

Answered
Can ables to view the plot in Matlab
I don't see why your using a loop (just vectorize using element wise operation) but try the below: Note: You haven't provided t...

7 years ago | 0

Answered
Iteration (Column times Column)
.^

7 years ago | 0

Answered
Receiving error messages when trying to numerically integrate this function
Use dot in front of arithmetic operators in the line s.

7 years ago | 0

Answered
Return matrix of maximum values
x(I) y(I)

7 years ago | 0

| accepted

Answered
how to find the index for the following code
“But I want to display the index of A using for loop” You don’t need one , see the documentation of fprintf(). Values=rand(1,1...

7 years ago | 0

Answered
How to access the specific value in table according to the input parameters?
LCA_Database(contains(LCA_Database.Name,'Construction Steel')&contains(LCA_Database.lca_phase,'D'),:)

7 years ago | 1

| accepted

Answered
Error using horzcat with num2str function for creating character class
Str = sprintf('psd_c_%d_by_%d_shaded_%d',Nt,Bd,Ns) doc sprintf % read it

7 years ago | 0

| accepted

Answered
Removing elements of array by condition and without resizing?
Result=arrayfun(@(x)nonzeros(a(x,:)).',1:size(a,1),'un',0); % where a is your matrix celldisp(Result)

7 years ago | 0

Answered
Vector as Function Input
% Function Test syms a b c test1 = b+a; test2 = b^2; test3 = a^2 + c^2; test = [test1;test2;test3]; test_input = num2cell(...

7 years ago | 0

Answered
Parse error: The expression to the left of the equals sign is not a valid target for an assignment.
Remove curly braces. B=sort(A); Numbering variables is not recommended.

7 years ago | 1

| accepted

Answered
User input in an array?
Use input() with 's' which refers to a string. https://www.mathworks.com/help/matlab/ref/input.html#btt5vtc-2

7 years ago | 0

Answered
I have a large vector, I would like to find a set of data which is a subset of the large vector.
[lo,ii]=ismember(B,A); index = ii(lo)

7 years ago | 1

Answered
How can I delete the repeated values and keep just a row of each one?
A = unique(sort(a,2),'rows') % where a is your matrix

7 years ago | 0

Answered
How to store output of a for loop in a matrix?
Idir=zeros(size(P)); % this is how you preallocate before loop Note: In this case you don’t need a loop.

7 years ago | 0

| accepted

Answered
How to calculate sum of all the possible combinations of two vector elements
C=reshape((A+B.')',[],1)'

7 years ago | 2

Answered
sym/double error(line 665)
P.S: There is a warning at the end but yields a result without error G = matlabFunction(sqrt(1 + g_x + g_y)); % read about matl...

7 years ago | 0

Answered
indexing an entire for loop
No loops needed: T = x.^2.' + 2*y.^2

7 years ago | 0

Answered
indexing an entire for loop
x = -3:0.1:3; y = -1:0.1:1; ii = length(x); jj = length(y); T = zeros(ii,jj); for k = 1:ii for l = 1:jj T(k,l...

7 years ago | 0

| accepted

Answered
What is wrong with this code?
Remove the single quotes from the last line, upload the code instead of a picture. a/rw^2 == (cos(x)+(n^2*cos(2*x)+sin(x)^4))/(...

7 years ago | 1

Answered
Distance between all elements of row vector
Straightforward: row.'-row

7 years ago | 0

Answered
Calculating mean over multiple dimensions
mean(data,'all') % or mean(data,[3 2 1])

7 years ago | 2

Load more