Community Profile

photo

madhan ravi


2,525 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
indexing an entire for loop
No loops needed: T = x.^2.' + 2*y.^2

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

5 hours ago | 0

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

5 hours ago | 0

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

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

1 day ago | 0

| accepted

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

1 day ago | 1

| accepted

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

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

1 day ago | 0

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

1 day ago | 0

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

2 days ago | 0

Answered
change appearance of formula
vpa(Total)

3 days 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)

3 days ago | 1

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

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

3 days ago | 1

| accepted

Answered
How to find rearrange these values in a new row and column?
newmatrix = matrix([2 4 5 8],:)

3 days ago | 0

Answered
Why does my index exceed array bounds for the following for loop?
You don’t need a loop mewp* % ^-—-—-missed it

3 days ago | 0

Answered
divide data according to year, month, day
https://www.mathworks.com/help/matlab/ref/datetime.ymd.html

4 days ago | 0

Answered
negative number in vector
c=v(1:find(v<0,1,'first')-1)

4 days ago | 1

| accepted

Answered
How to read only 1 value in row 2, column 1 ?
M = dlmread('csvlist.dat',',',[0,1,0,1])

4 days ago | 0

Answered
How to find first non repeated (unique) character in a string?
u=unique(s,'stable'); % where s is your input Z=arrayfun(@(x)nnz(s==u(x)),1:numel(u)); Result=u(find(Z==1,1,'first'))

4 days ago | 1

| accepted

Answered
Merge two matrices taking non-Null values
C=zeros(size(A)); C(:,~all(isnan(A)))=A(:,~all(isnan(A))); C(:,~all(isnan(B)))=B(:,~all(isnan(B)));

4 days ago | 0

| accepted

Answered
How to remove numbers between specific symbols in text array?
a="Gas_1_O2"; regexprep(a,'\_\d*.?\d*\_','_')

4 days ago | 0

| accepted

Answered
Problem in running my code
Don't name variable max because there is an inbuilt function named max(), preallocate Rhn for speed and efficiency: TN=4; n_ve...

4 days ago | 0

Answered
dsolve problem not showing result
syms y(x) eqn = diff(y) == y/x; vars = y(x); V = odeToVectorField(eqn) M = matlabFunction(V,'vars', {'x','Y'}) interval = [...

4 days ago | 1

| accepted

Answered
I am getting an error like function definitions are not permitted in this context in matlab R2014b
P.s - I am not going to look into your code. I am just answering your main question. https://www.mathworks.com/help/matlab/ref/...

4 days ago | 0

Answered
Can't get fprintf to display my equations answer
%.2f ^-—-—missed it

5 days ago | 0

| accepted

Answered
Problem when importing a TXT file into MATLAB with "readtable". Text and numbers are between single quotes...
T=table2cell(data); T(:,3:end)=cellfun(@str2double,T(:,3:end),'un',0)

5 days ago | 0

Answered
indexing multiple values in two arrays with different size
A=sum(a(:,1)==b(:,1).'); a(:,2)=repelem(b(:,2),A).'

5 days ago | 0

| accepted

Load more