Answered
Index in position 2
for tdx = 2:length(t_vec)-1

7 years ago | 0

Answered
Trying to find last non-zero element in each column of a matrix and make a vector out of it
arrayfun(@(x)find(data(:,x),1,'last'),1:size(data,2))

7 years ago | 1

Answered
Not enough input arguments error MATLAB
https://in.mathworks.com/help/matlab/matlab_prog/run-functions-in-the-editor.html

7 years ago | 0

Answered
Conditional 'for loop', simpler ?
No loops needed: L=zeros(size(A)); M=zeros(size(B)); L(s<A)=A(s<A).*sin(s); M(s<A)=B(s<A).*sin(s) L(s>A)=A(s>A).*cos(s/2); ...

7 years ago | 1

| accepted

Answered
convert number to string problem
sprintfc('Data Set %d',test) % beware undocumented

7 years ago | 1

| accepted

Answered
Why do I keep getting a subplot error?
You have a filenamed subplot.m which shadows the function named subplot() please remove it from the path or delete it.

7 years ago | 0

| accepted

Answered
I would add one variable inside function
Read about subs() : syms a t theta x(t)=5*sin(2*t+theta); subs(x(t)*x(t+a),{t,a,theta},{1,2,3}) % t with value one ,a with 2 ...

7 years ago | 0

| accepted

Answered
Call the data in string
fruit.apple=[1 0 0 1 0 1]; fruit.orange=[1 0 0 1 1 1 1 0]; fruit.guava=[1 1 0 1 1 0 1 0]; fruit....

7 years ago | 0

Answered
how to write in my x line pi instead of the actual number ?
* for matrix mulitplication doc mtimes .* for element wise multiplication doc times xlim([0 6*pi]) xticks(0:pi:6*pi) x...

7 years ago | 0

| accepted

Answered
how to add different values to some particular rows and columns?
Since 2016b: b=a; b(2:end,2:end)=b(2:end,2:end)+(1:size(b,1)-1).' Prior to 2016b: b=a; b(2:end,2:end)=bsxfun(@plus,b(2:...

7 years ago | 0

| accepted

Answered
why the error says Error: File: untitled14.m Line: 15 Column: 1 This statement is not inside any function. (It follows the END that terminates the definition of the function "untitled14".)
I don’t why your doing it the hard way. See a short example to do it using logical indexing: x=1:.01:10; y=zeros(size(x)); y(...

7 years ago | 0

Answered
plotting all on same figure
Remove clc, clear and close all. Use hold on after the first plot command. Also defining xlabel() , ylabel() and title() once i...

7 years ago | 0

| accepted

Answered
Question about the summation of array of elements with complex double
sum(sym(m))

7 years ago | 0

| accepted

Answered
How to detect certain values within the data?
nnz(matrix==2)

7 years ago | 0

Answered
finding maximum value of a plot
[max_value,index]=max(b1)

7 years ago | 2

Answered
How to model a=a+b in simulink?

7 years ago | 1

Answered
How to use <, > operator as I intended
(y1>0) & (y1<3)

7 years ago | 0

| accepted

Answered
Plotting Table, but "Too Many Input Arguments"
plot(filename{:,2},filename{:,11})

7 years ago | 0

| accepted

Answered
select a random number from each row in a matrix with changable columns
arrayfun(@(x)a(x,randi(size(a,2))),1:size(a,1)).' % a your matrix

7 years ago | 0

Answered
Dividing each column value by another column value in a matrix
matrix(:,3)./matrix(:,4)

7 years ago | 1

| accepted

Answered
merge cell data in cell
[A,B,C]

7 years ago | 0

| accepted

Answered
vectors must be the same length ode45 plotting functions
https://in.mathworks.com/matlabcentral/answers/448407-vectors-must-be-the-same-length-ode45-plotting-functions#comment_678078

7 years ago | 0

| accepted

Answered
average and variance of a double array
doc mean doc var

7 years ago | 0

| accepted

Answered
fzero for a loop of functions
%------------------------------ CODES T = 213.15:5:333.15; Results=zeros(25,1); for n=1:25 Results(n)=fzero(@(v)TerminalV(v,...

7 years ago | 1

| accepted

Question


Why the first number is not displayed? [SIMULINK]
Even if the variable block is connected to the workspace block the first value is not stored, why?

7 years ago | 1 answer | 0

1

answer

Answered
Sum between cells in an array of cells bypassing NaN
sum(cat(3,anos{:}),3,'omitnan')

7 years ago | 0

Answered
Add a integer at specific row
Anew = A; Anew(B) = 1

7 years ago | 0

| accepted

Answered
Remove duplicate rows based on subset of row elements
A(unique(A(1:3),'rows'),:)

7 years ago | 0

| accepted

Load more