Answered
How can i add zeros to same specified matrix column and row?
[m,n] = size(A); rc = [4,5]; % where to place zeros N = 2; % 2 columns and rows b = zeros(m+N,N+n); R = setdiff(1:...

6 years ago | 0

| accepted

Answered
i don't understand
Replace 1 with ~0 and 0 with ~1.

6 years ago | 0

| accepted

Answered
My loop returns imaginary results!
Evaluate the part ((16.6 - sum(A(1:i-1,:)))/ 42) and see what happens when the sum(...) is greater than 16.6 Note: N...

6 years ago | 0

| accepted

Answered
change order of a row vector
ix = setdiff(1:numel(vector), B); Wanted = [vector(B), vector(ix)]

6 years ago | 0

| accepted

Answered
I cannot write a system with three equations with cases
Use equation -> LaTeX and: \begin{cases} eq 1 \\ eq 2 \\ eq 3 \end{cases}

6 years ago | 1

| accepted

Answered
How to add new field to existing structure?
If S is your struct: S.Newfield = "Hi there;)"

6 years ago | 2

Answered
How to define simultaneous equations for ODE45
f1 = @(t,x) x(1) + x(2) f2 = @(t,x,a) x(1)-a*x(2) F = @(t,x,a) [f1(t,x);f2(t,x,a)]

6 years ago | 0

| accepted

Answered
how to display images in separate figures?
for k = 1:8 figure(k) I = imread(sprintf('im%d',k)); % you forgot to read the image imshow(I) end

6 years ago | 0

Answered
finding repeated values of two columns data?
No loops needed: [Rows,~,c]= unique(ex,'rows'); Counts = accumarray(c,1); Wanted = [table(Rows),table(Counts)...

6 years ago | 0

| accepted

Answered
Ploting a series and finding lim to infinity
N = 1e2; % an inf number a = zeros(1,N); a(1) = 1/3; a(2) = 2/7; for n = 1:N-2 a(n+2) = a(n+1) / (n+1)...

6 years ago | 0

Answered
what is the difference of plot 3d and comet 3d?
doc comet3 doc plot3

6 years ago | 0

| accepted

Answered
How to add a label to a general line
Use sprintf(...)

6 years ago | 0

Answered
Sizing in subplot()
Plot first 4 graphs in a separate figure and the next four in the other.

6 years ago | 0

Answered
Not enought input arguments
Use function in a proper way. Please see the documentation on how to call a function properly.

6 years ago | 0

Answered
How can I replace "" entries in a table?
iX=str2double(TT.vm2PR); TT.vm2PR(isnan(iX))=0

6 years ago | 0

| accepted

Answered
naming figure window in a for loop
figure('Name',sprintf('single mode efficiency is %6.2f% \n',mean_E))

6 years ago | 0

| accepted

Answered
Function calls of both script and Inline variety
There’s one additional “)” in the inline(...) function. Remove it.

6 years ago | 1

| accepted

Answered
MATLAB Y軸の最大値におけるX軸のあたい
% An example x = 0:pi/2:4*pi; y = sin(x); [PeaKs,ix]= findpeaks(y) % for negative peaks use -y X_axis = sym(x(ix))...

6 years ago | 1

Answered
How do I correctly enter the function f(x,y)=sin((pi/2)*(x+y))?
% Option 1 x = [x0,x1]; y = [y0,y1]'; z = sin(pi/2*(x+y)); F = griddedInterpolant({x,y},z); xq = 1/...

6 years ago | 0

Answered
How to correctly get a sine/cosine-signal in Simulink?
<https://youtu.be/iOmqgewj5XI> , cos(...) is the sin(...) with phase shift.

6 years ago | 0

Answered
How can I make my script decide which scalar of two variables is larger?
MAX = max(bx,cy)

6 years ago | 0

| accepted

Answered
I keep getting two answers for my code
Add a semicolon in the last line. And call the function with an output argument.

6 years ago | 0

Answered
Solve ODE with odee45
ic=randi([0,1],4,1) ode45(@(t,y)myfunc(t,y,5),[0,10],ic) function dy = myfunc(t,y,vas) dy=zeros(4,1); dy(1) = ...

6 years ago | 0

| accepted

Answered
Function sinc in matlab
y = (4000 * sinc(4000 * x)) .* (exp(j * 2 * pi *7000 * x)); % .*!! Note: By default j is an imaginary number in MATLAB

6 years ago | 1

| accepted

Answered
using plotyy but having 2 different measuring units on y axis
yyaxis left plot(x,value1) yyaxis right plot(x,value2)

6 years ago | 0

Answered
Manipulating Arrays using for loop
doc repmat

6 years ago | 0

Answered
How to manipulate MATRIX size
[Matrix,zeros(31,104-90)]

6 years ago | 0

Answered
What is the notation meaning in these codes
u = 1:6 u(1:3) u(4:6)

6 years ago | 0

Answered
problem with rref function please help
Use a semicolon or a comma before rref(...)

6 years ago | 0

Load more