Community Profile

photo

madhan ravi


2.539 total contributions since 2018

Communication through MATLAB is always better than arguing.

madhan ravi's Badges

  • 6 Month Streak
  • Ace
  • Thankful Level 3
  • Knowledgeable Level 4
  • Promoter
  • Commenter
  • Revival Level 3
  • Solver
  • First Answer

View details...

Contributions in
View by

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

etwa 2 Stunden ago | 0

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...

etwa 3 Stunden 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'),:)

etwa 4 Stunden 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

etwa 12 Stunden ago | 0

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)

ein Tag 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(...

ein Tag 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.

ein Tag ago | 0

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

2 Tage ago | 0

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

2 Tage 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.

2 Tage ago | 0

| accepted

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

2 Tage ago | 1

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...

2 Tage ago | 0

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

3 Tage 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...

3 Tage 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))/(...

3 Tage ago | 1

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

3 Tage ago | 0

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

3 Tage ago | 0

Answered
Plot multiple data in one plot using for loop
If you look the data in each cell closely infact they are all the same so all the plots overlap each other: plot(x,[y{:}]) % yo...

4 Tage ago | 0

| accepted

Answered
write statement without using for loop
gi=Alpha.*(bi==0)+Beta.*(bi==1)

4 Tage ago | 1

| accepted

Answered
For loop averaging increments
Since it’s homework take mean along the first dimension: doc mean

4 Tage ago | 0

Answered
How can I subs 2 symbolic vectors in 1 comand?
Edit: Corrected the mistake. A workaround: Z=matlabFunction([X,Y]); % change this line XY=num2cell([X0,Y0]); Z(XY{:}) % eval...

4 Tage ago | 0

Answered
How can I type inverse sign in axis labels? like 1/CL
xlabel('$\frac{1}{CL}$','Interpreter','latex')

4 Tage ago | 0

Answered
How can I get outcome at a particular value after performing differentiation?
Another option: dx(x)=diff(f); dx(3)

5 Tage ago | 0

Answered
change appearance of formula
vpa(Total)

5 Tage ago | 0

| accepted

Answered
How to Show 1/4 in 1/2^2?
I can only think of printing it using fprintf(): fprintf('1/%d^2 ',x)

5 Tage ago | 1

Answered
Find the row number of element that meets the condition
index=find(A>500,1,'first') B(index)

5 Tage ago | 1

| accepted

Answered
read csv file in sequence and post process data
Use cell arrays instead of numbering variables ( https://www.mathworks.com/matlabcentral/answers/105936-how-to-make-dynamic-vari...

5 Tage ago | 1

| accepted

Load more