Answered

Why can't I calculate the definite integral?

h_min=0.5; h_max=1.16; pom_lc=1.21; syms t f = 1-exp(t/pom_lc) F = vpaintegral(f, t, [h_min h_max]) % double(), vpa() will ...

Why can't I calculate the definite integral?

h_min=0.5; h_max=1.16; pom_lc=1.21; syms t f = 1-exp(t/pom_lc) F = vpaintegral(f, t, [h_min h_max]) % double(), vpa() will ...

1 year ago | 0

Answered

How to produce line plot yline for matlab R2018a

Start = 0; % sorry I completely misinterpreted the question xD End = 1; Point = 260; plot(linspace(Start, End, 1e2), repelem(...

How to produce line plot yline for matlab R2018a

Start = 0; % sorry I completely misinterpreted the question xD End = 1; Point = 260; plot(linspace(Start, End, 1e2), repelem(...

1 year ago | 0

| accepted

Answered

How to produce line plot yline for matlab R2018a

Funny thing , i did a file exchange a while ago for passing time, not the efficient one but gets the job done ;) https://www.ma...

How to produce line plot yline for matlab R2018a

Funny thing , i did a file exchange a while ago for passing time, not the efficient one but gets the job done ;) https://www.ma...

1 year ago | 0

Answered

plotting multiple values of a parameter on same figure

Amplitude = rand(5, 1); hold on for k = 1 : numel(Amplitude) % this is an example of having different amplitudes, follow thi...

plotting multiple values of a parameter on same figure

Amplitude = rand(5, 1); hold on for k = 1 : numel(Amplitude) % this is an example of having different amplitudes, follow thi...

1 year ago | 0

| accepted

Answered

how to continuously loop until a condition is met?

value = % calculate mode; while 1 if ((value <= 4e2) && (value <= 1e3)) break else % value = calcul...

how to continuously loop until a condition is met?

value = % calculate mode; while 1 if ((value <= 4e2) && (value <= 1e3)) break else % value = calcul...

1 year ago | 0

Answered

Warning: Matrix is singular to working precision.

% Black Scholes Vanna % Steven Semeraro sigma = ones(100, 100) * 0.2; stock = ones(100, 100) * 50; x = 1:100; y = ...

Warning: Matrix is singular to working precision.

% Black Scholes Vanna % Steven Semeraro sigma = ones(100, 100) * 0.2; stock = ones(100, 100) * 50; x = 1:100; y = ...

1 year ago | 0

Answered

Error while vectorizing my code

terms = 1 ./ (n( : ) .^ x) % < 2016b 1 ./ bsxfun(@power, n( : ), x)

Error while vectorizing my code

terms = 1 ./ (n( : ) .^ x) % < 2016b 1 ./ bsxfun(@power, n( : ), x)

1 year ago | 1

Answered

Matlab, automatically delete the index variable after the execution of a loop, Part 2

That is the simpler way.

Matlab, automatically delete the index variable after the execution of a loop, Part 2

That is the simpler way.

1 year ago | 1

| accepted

Answered

How do I create a matrix from from the answers of each iteration of a for loop?

N = 4; yn = cos(pi * ( 0 : N ) / N); yp = cos(pi * ( 0 : N ) / N); yp = reshape(yp, 1, 1, []); bottom = squeeze(1 ./ (yn - y...

How do I create a matrix from from the answers of each iteration of a for loop?

N = 4; yn = cos(pi * ( 0 : N ) / N); yp = cos(pi * ( 0 : N ) / N); yp = reshape(yp, 1, 1, []); bottom = squeeze(1 ./ (yn - y...

1 year ago | 0

| accepted

Answered

Output of previous command into input

If those variables are in the workspace, it should run without any problems. Ca1 = ...; Ca2 = ...; Ca3 = ...; Ca4 = ...; Cb...

Output of previous command into input

If those variables are in the workspace, it should run without any problems. Ca1 = ...; Ca2 = ...; Ca3 = ...; Ca4 = ...; Cb...

1 year ago | 0

| accepted

Answered

creating new variable using for loop and if-else condition

age = 1 : 40; % you were almost close, note: it could be done without loops [new_age_group1, new_age_group2] = deal(cell(40, 1)...

creating new variable using for loop and if-else condition

age = 1 : 40; % you were almost close, note: it could be done without loops [new_age_group1, new_age_group2] = deal(cell(40, 1)...

1 year ago | 0

| accepted

Answered

Can one substitute string values in a matrix?

dum = strings(height(T), 1); % you could also use repmat or repelem to do it in one line dum(:) = "January";

Can one substitute string values in a matrix?

dum = strings(height(T), 1); % you could also use repmat or repelem to do it in one line dum(:) = "January";

1 year ago | 0

| accepted

Answered

What is this block called and where can I find it?

https://www.mathworks.com/help/simulink/slref/integrator.html

What is this block called and where can I find it?

https://www.mathworks.com/help/simulink/slref/integrator.html

1 year ago | 0

| accepted

Answered

How do i save values in a loop to vectors?

V = cell(2, 1); % an example on how to store for l = 1 : 2 V{l} = rand(2, 1); end celldisp(V)

How do i save values in a loop to vectors?

V = cell(2, 1); % an example on how to store for l = 1 : 2 V{l} = rand(2, 1); end celldisp(V)

1 year ago | 0

| accepted

Answered

Question here Matlab basics,

c * (c + d) % MATLAB doesnâ€™t have implicit multiplication

Question here Matlab basics,

c * (c + d) % MATLAB doesnâ€™t have implicit multiplication

1 year ago | 0

| accepted

Answered

if statement find criteria not doing what I want it to do

neqchek = @(k) subsasgn(k, substruct('()', {k(1) == 1}), 10); out = neqchek([1 : 2, 1])

if statement find criteria not doing what I want it to do

neqchek = @(k) subsasgn(k, substruct('()', {k(1) == 1}), 10); out = neqchek([1 : 2, 1])

1 year ago | 0

Answered

Change data type of entire cell array?

cellfun(@(x) sscanf(x, '%d').', Cell_array, 'un', 0)

Change data type of entire cell array?

cellfun(@(x) sscanf(x, '%d').', Cell_array, 'un', 0)

1 year ago | 0

Answered

How do I make a function with 2 parameters?

Man muss einfach versuchen. doc function

How do I make a function with 2 parameters?

Man muss einfach versuchen. doc function

1 year ago | 0

Answered

Delete specific numbers from cell array

p2 = [1, 2; 0, 1] p3 = num2cell(p2, 1); Wanted = cellfun(@nonzeros, p3, 'un', 0)

Delete specific numbers from cell array

p2 = [1, 2; 0, 1] p3 = num2cell(p2, 1); Wanted = cellfun(@nonzeros, p3, 'un', 0)

1 year ago | 1

Answered

Assign Values into a matrix (DG)

matrix(:, 1) = linspace(matrix(1, 1), 0, size(matrix, 1)); matrix(:, end) = linspace(matrix(1, end), 0, size(matrix, 1))

Assign Values into a matrix (DG)

matrix(:, 1) = linspace(matrix(1, 1), 0, size(matrix, 1)); matrix(:, end) = linspace(matrix(1, end), 0, size(matrix, 1))

1 year ago | 0

Answered

how do i print only the last answer in a for loop

c(k,j) = (c(k+1, j-1) - c(k,j-1))/(x(k+j-1)-x(k)); %<- semicolon

how do i print only the last answer in a for loop

c(k,j) = (c(k+1, j-1) - c(k,j-1))/(x(k+j-1)-x(k)); %<- semicolon

1 year ago | 0

Answered

Need help starting this code!!! Arrays

https://www.mathworks.com/matlabcentral/answers/213823-forward-backward-and-central-differences

Need help starting this code!!! Arrays

https://www.mathworks.com/matlabcentral/answers/213823-forward-backward-and-central-differences

1 year ago | 0

Answered

std function won't execute

You have a file named std.m , rename it or remove it from the path.

std function won't execute

You have a file named std.m , rename it or remove it from the path.

1 year ago | 0