답변 있음

Error in plotting (blank graph): Vector Size

No loops needed: eta = -0.001778 * v.^2 + 0.05333 * v; eta(30 : end) = 0;

Error in plotting (blank graph): Vector Size

No loops needed: eta = -0.001778 * v.^2 + 0.05333 * v; eta(30 : end) = 0;

3달 전 | 0

답변 있음

Trying to input multiple vectors into function

stagpres1 = stagpres(1:10, 1:10) function stagpres1 = stagpres(deltaP, flowarea) gmpercm2 = deltaP * 0.010197; %...

Trying to input multiple vectors into function

stagpres1 = stagpres(1:10, 1:10) function stagpres1 = stagpres(deltaP, flowarea) gmpercm2 = deltaP * 0.010197; %...

3달 전 | 0

| 수락됨

답변 있음

What is the problem with the code on the line that reads "disp({'Coordinates For Node ' num2str(k1) ' ^re: '})

{} -> [] , simply use sprintf() on that line

What is the problem with the code on the line that reads "disp({'Coordinates For Node ' num2str(k1) ' ^re: '})

{} -> [] , simply use sprintf() on that line

3달 전 | 1

| 수락됨

답변 있음

Evaluate function over a mesh grid (without for loops)

v = num2cell([X(:), Y(:)], 2); Z = reshape(cellfun(Jfun, v), size(X));

Evaluate function over a mesh grid (without for loops)

v = num2cell([X(:), Y(:)], 2); Z = reshape(cellfun(Jfun, v), size(X));

3달 전 | 0

답변 있음

Finding the index in two different arrays where values are closest

Note: Not tested. ix = abs(a(:) - b(:).'); [~, ID] = min(ix(:)); [where_a, where_b] = ind2sub(size(ix), id)

Finding the index in two different arrays where values are closest

Note: Not tested. ix = abs(a(:) - b(:).'); [~, ID] = min(ix(:)); [where_a, where_b] = ind2sub(size(ix), id)

3달 전 | 0

답변 있음

Multiplication of 1D and 2D vector to a 3D vector

[m, n] = size(B); C = zeros(m, n, numel(A)); for k = 1:numel(A) C(:, :, A(k)) = B; end C

Multiplication of 1D and 2D vector to a 3D vector

[m, n] = size(B); C = zeros(m, n, numel(A)); for k = 1:numel(A) C(:, :, A(k)) = B; end C

3달 전 | 0

답변 있음

Multiplication of 1D and 2D vector to a 3D vector

Sigh. Your question says one thing and your example does another thing. Only God know what you want. C = repmat(B, 1, 1, max...

Multiplication of 1D and 2D vector to a 3D vector

Sigh. Your question says one thing and your example does another thing. Only God know what you want. C = repmat(B, 1, 1, max...

3달 전 | 0

답변 있음

Multiplication of 1D and 2D vector to a 3D vector

C = reshape(A, 1, 1, []) .* B % use bsxfun() if you’re version is prior to 2016b C = bsxfun(@times, reshape(A, 1, 1, []), B)...

Multiplication of 1D and 2D vector to a 3D vector

C = reshape(A, 1, 1, []) .* B % use bsxfun() if you’re version is prior to 2016b C = bsxfun(@times, reshape(A, 1, 1, []), B)...

3달 전 | 0

답변 있음

Integrate an acceleration vector to obtain a velocity vector

Use cumtrapz() doc cumtrapz

Integrate an acceleration vector to obtain a velocity vector

Use cumtrapz() doc cumtrapz

3달 전 | 0

| 수락됨

답변 있음

Imaginary Number Notation/ Formatting Real and Complex Results

The imaginary part might not be exactly zero. vpa(Answer)

Imaginary Number Notation/ Formatting Real and Complex Results

The imaginary part might not be exactly zero. vpa(Answer)

3달 전 | 1

답변 있음

Beginning matlab user error, functions

Take that fminsearch() outside of the function doc function % see how to use functions

Beginning matlab user error, functions

Take that fminsearch() outside of the function doc function % see how to use functions

3달 전 | 0

| 수락됨

답변 있음

sin() - Subscript indices must either be real positive integers or logicals.

clear sin % since it's a variable

sin() - Subscript indices must either be real positive integers or logicals.

clear sin % since it's a variable

3달 전 | 1

| 수락됨

답변 있음

How do I simplify the values of a function?

>> a a = 2 >> b b = 4 >> syms x f(x) = a*b + b*x f(x) = 4*x + 8 >>

How do I simplify the values of a function?

>> a a = 2 >> b b = 4 >> syms x f(x) = a*b + b*x f(x) = 4*x + 8 >>

3달 전 | 0

| 수락됨

답변 있음

2 Scenario Legend Setup

plot(1:5, '-k') hold on plot(6:10, ':y') legend({'Leg 1', 'Leg2'}) %?

2 Scenario Legend Setup

plot(1:5, '-k') hold on plot(6:10, ':y') legend({'Leg 1', 'Leg2'}) %?

3달 전 | 0

답변 있음

How to write delta in matlab?

<https://www.mathworks.com/help/symbolic/sym.dirac.html>

How to write delta in matlab?

<https://www.mathworks.com/help/symbolic/sym.dirac.html>

3달 전 | 0

답변 있음

How to get == to help solving equations

You should have the Symbolic Math Toolbox and the license for it to perform the above operation. In order to replicate your mess...

How to get == to help solving equations

You should have the Symbolic Math Toolbox and the license for it to perform the above operation. In order to replicate your mess...

3달 전 | 0

답변 있음

How to use blkdiag in 3D matrix

A slight variation: M = cell(size(B, 3), 1); for k = 1 : size(A, 3) M{k} = blkdiag(A(:, : , k), B(:, :, k)); end M =...

How to use blkdiag in 3D matrix

A slight variation: M = cell(size(B, 3), 1); for k = 1 : size(A, 3) M{k} = blkdiag(A(:, : , k), B(:, :, k)); end M =...

3달 전 | 0

답변 있음

How do I add color to text output to the Command Window?

https://www.mathworks.com/matlabcentral/fileexchange/24093-cprintf-display-formatted-colored-text-in-the-command-wind

How do I add color to text output to the Command Window?

https://www.mathworks.com/matlabcentral/fileexchange/24093-cprintf-display-formatted-colored-text-in-the-command-wind

3달 전 | 0

답변 있음

Need help inputting my equation into MATLAB

In line f, M(t) causes the error perhaps you mean‘t M*t ?

Need help inputting my equation into MATLAB

In line f, M(t) causes the error perhaps you mean‘t M*t ?

3달 전 | 0

답변 있음

How to store value of for loop in a array

for z = linspace(0, 0.03, 31) By the way you don’t need a Loop it’s simply: A = 1 ./ (1 + ((z / aes) .^ 2))

How to store value of for loop in a array

for z = linspace(0, 0.03, 31) By the way you don’t need a Loop it’s simply: A = 1 ./ (1 + ((z / aes) .^ 2))

3달 전 | 0

답변 있음

solve first-order ODE

ode = @(t, Y) sin( exp(Y - t/2) - t^2/2 ) ode45(ode, [0 2*pi], 0)

solve first-order ODE

ode = @(t, Y) sin( exp(Y - t/2) - t^2/2 ) ode45(ode, [0 2*pi], 0)

3달 전 | 0