Answered
How to plot points without line
plot(x,y,'or')

7 years ago | 3

| accepted

Answered
How can I replace for loop with meshgrid?
You don't need a meshgrid to do the task: [ m, n ] = size( b ); d = zeros( m, n ); d( 2 : m, 2 : n ) = b( 1 : end - 1, 2 : en...

7 years ago | 1

Answered
How can I type and plot this equation?
./

7 years ago | 0

| accepted

Answered
Extract particular element from cell and create table with titles
T = array2table(cellfun(@(x)x(396),C),'VariableNames',{'A','B','C','D'}) % C is your cell array

7 years ago | 0

| accepted

Answered
Problems with nested indexing
Remove (1) from the last two lines.

7 years ago | 0

Answered
column vector with specific entries for first 4 terms
syms x % just define x as symbolic variable Coeff = sym(zeros(16,1)); Coeff(1:4) = (-(1:4).*x).'

7 years ago | 0

Answered
Contributors metainfo: reputation and more
Congratulations Rik for surpassing 3000 points!

7 years ago | 0

Answered
What is the best way to save data into a txt file
If your using 2019a you may try the newly introduced writematrix().

7 years ago | 0

| accepted

Answered
Couldn't find what's wrong
q = 3; b = find( cellfun( @numel, a ) == q ) %or b = find( cellfun( 'prodofsize', a ) == q )

7 years ago | 1

| accepted

Answered
How to sort only nonzeros values of an array that is linked to cell array ?
[~,I] = sort(vertcat(T{:,3})); sorted_T = T(I,:); Corresponding_matche_s = T(vertcat(T{:,3})==6.008,:)

7 years ago | 0

| accepted

Answered
How do I put this formula int matlab?
https://in.mathworks.com/matlabcentral/answers/451685-how-do-i-put-this-formula-int-matlab#comment_684284

7 years ago | 1

| accepted

Answered
How to put hat over a greek symbol express its value in legend of a plot?
legend(sprintf('$\\hat{\\alpha}(0) = %d$',2),'Interpreter','latex') % ^----- numeric va...

7 years ago | 1

| accepted

Answered
Transforming a multidimensional array to a two dimensional array?
reshape( yourmatrix, [ N N*n ] )

7 years ago | 1

| accepted

Answered
Check if element in array are square of each other
nnz(V.^2==V.')>=1 % where V your vector, result 0 means false, 1 means true

7 years ago | 2

Answered
How to append elements in a vector one by one
No loop is needed: Vertically concatenate the two vectors and use reshape.

7 years ago | 0

Answered
symbolic substitution dfgsdfgs dfgsdfgs
subs(eq1,z,rhs(eq2))

7 years ago | 1

Answered
Selecting a Range of Rows in An Array Based off a Certain Value.
a(1:find(a(:,3)==1,1,'first')-1,:) % a your matrix

7 years ago | 0

Answered
How can I use a loop and solve or ode45 to plot dy +4y=10 with y(0) = 0:0.1:2? Plot each solution on the same graph.
Show your attempt to get further help: y0 = 0:.1:2; % before loop ic = y(0)==y0(k) % inside loop % k loop iterator doc dso...

7 years ago | 0

Answered
confusion related to 'for' loop.
p = num2cell(2.^(1:8))

7 years ago | 0

| accepted

Answered
How to create a matrix using conditional statements in a loop based in another matrix
H=zeros(size(Comb,1),1); idx=any(Comb,2); H(idx)=sum(Comb(idx,:),2)

7 years ago | 1

Answered
How to compare and combine two matrix
idx=A1(:,1)==A2(:,1); A3=[A1(idx,:),A2(idx,2:end)]

7 years ago | 0

| accepted

Answered
Matlab is not drawing my 3D function correctly with surf command
z = (c*x.^2)-(d*x.^2.*y.^2); % ^---- element - wise operation

7 years ago | 0

| accepted

Answered
How to split a vector in many sub-vectors with different sizes ?
Sub=mat2cell(A,1,[3,1,2,4]); Sub{:}

7 years ago | 0

Answered
Taking average of 3 rows from a matrix
Simpler and faster than the other two: [m,n]=size(A); % A is your matrix Mean=reshape(mean(reshape(A,3,[])),[],n)

7 years ago | 1

| accepted

Answered
Taking average of 3 rows from a matrix
Using mat2cell() and cellfun() is slower than an explicit loop follow this instead: [m,n]=size(A); % A is your matrix U1=resha...

7 years ago | 0

Answered
How to combine two matrix
a.'*b % a size 1 X 120 % b size 1 X 2001

7 years ago | 0

| accepted

Answered
Trying to get name to print in the display
%s

7 years ago | 0

Answered
Para error at END
The loop has for missing at the beginning should be for ii = 1:21 cos() not cod().

7 years ago | 0

Answered
Error in plot function
You have a script named plot.m please remove it from the path ,rename or delete it , it is shadowing the in-built plot() functio...

7 years ago | 3

| accepted

Answered
Do I need pre-allocation ?
Preallocation is not necessary in your second version.

7 years ago | 0

Load more