Answered

find magnitude of approximate percent relative error

a=(-1).^k.*(x.^(2*k+1)./factorial(2*k+1)); MagTrueerr=abs(cumsum(a)-f_exact); MAPRE=100*MagTrueerr./cumsum(a); No loops neede...

find magnitude of approximate percent relative error

a=(-1).^k.*(x.^(2*k+1)./factorial(2*k+1)); MagTrueerr=abs(cumsum(a)-f_exact); MAPRE=100*MagTrueerr./cumsum(a); No loops neede...

19 hours ago | 0

Answered

How can I deleate or replace with a 0 all the Nan, Inf anf -Inf values in a time series from the biggining to the end?

A(~isnan(A)&A~=Inf);

How can I deleate or replace with a 0 all the Nan, Inf anf -Inf values in a time series from the biggining to the end?

A(~isnan(A)&A~=Inf);

19 hours ago | 0

Answered

function results into a vector

You just need a dot! Vreg = [(230-(VL))./(VL)];

function results into a vector

You just need a dot! Vreg = [(230-(VL))./(VL)];

19 hours ago | 0

Answered

How tatement to use if statement to eliminate unwanted value

m=max(i(i~=Inf));

How tatement to use if statement to eliminate unwanted value

m=max(i(i~=Inf));

23 hours ago | 0

| accepted

Answered

I can't figure out this matlab function that returns the exponential of each element

function ex = seriesExp(x) i=0:9; ex=arrayfun(@(x)sum(x.^i./factorial(i)),x); end

I can't figure out this matlab function that returns the exponential of each element

function ex = seriesExp(x) i=0:9; ex=arrayfun(@(x)sum(x.^i./factorial(i)),x); end

23 hours ago | 0

Answered

how to remove the error showing undefined function or variable

Preallocate X1 before the loop. X1=zeros(m1*k2,n1);

how to remove the error showing undefined function or variable

Preallocate X1 before the loop. X1=zeros(m1*k2,n1);

24 hours ago | 0

| accepted

Answered

How can i index a matrix to do implicit multiplication to each value in a row with a vector?

A(:,1:3).*s

How can i index a matrix to do implicit multiplication to each value in a row with a vector?

A(:,1:3).*s

1 day ago | 0

| accepted

Answered

How do I calculate the square of TStep5 divided by the average of TStep4 and TStep2?

TStep5^2/mean([TStep4,TStep2]); If you explained what you really what to do, it would be easier to help. There is likely a must...

How do I calculate the square of TStep5 divided by the average of TStep4 and TStep2?

TStep5^2/mean([TStep4,TStep2]); If you explained what you really what to do, it would be easier to help. There is likely a must...

1 day ago | 0

Answered

How would I convert this equation to code? My likely flawed coding is below. Thanks!

Assuming L and T are vector arrays of equal length and all others are defined constants. es=e0*exp((L/rv).*(1/t0 - 1./T));

How would I convert this equation to code? My likely flawed coding is below. Thanks!

Assuming L and T are vector arrays of equal length and all others are defined constants. es=e0*exp((L/rv).*(1/t0 - 1./T));

1 day ago | 0

Answered

While function for finding the checking each elements in a vector of unknown length

A-10*(A>70);

While function for finding the checking each elements in a vector of unknown length

A-10*(A>70);

1 day ago | 0

Answered

How can I create multiple arrays, based on unique column values, from a single array?

For your array x: function Plot(x) hold on; z=x(:,1); arrayfun(@(y)plot(x(ismember(z,y),3),x(ismember(z,y),2),'Marker','*','...

How can I create multiple arrays, based on unique column values, from a single array?

For your array x: function Plot(x) hold on; z=x(:,1); arrayfun(@(y)plot(x(ismember(z,y),3),x(ismember(z,y),2),'Marker','*','...

1 day ago | 0

Answered

backward recurssion in a loop

c=zeros(9,20); c(9,:)=b(9,:)-a(9,:); for i=8:-1:1 c(i,:)=c(i+1,:)-a(i,:); end

backward recurssion in a loop

c=zeros(9,20); c(9,:)=b(9,:)-a(9,:); for i=8:-1:1 c(i,:)=c(i+1,:)-a(i,:); end

1 day ago | 0

| accepted

Answered

help plotting basic x vs y?

x =linspace(0,L,100); y =w0./(120*E*I*L)*(-5*x.^4+6*L^2*x.^2-L^4); plot(x,y);

help plotting basic x vs y?

x =linspace(0,L,100); y =w0./(120*E*I*L)*(-5*x.^4+6*L^2*x.^2-L^4); plot(x,y);

2 days ago | 0

| accepted

Answered

correlation coefficients for a matrix that includes NaNs

[R,P]=corrcoef(rmmissing(PK6mab)); If you can tolerate deleting the entire rows of any missed data.

correlation coefficients for a matrix that includes NaNs

[R,P]=corrcoef(rmmissing(PK6mab)); If you can tolerate deleting the entire rows of any missed data.

2 days ago | 0

Solved

Tell me the slope

Tell me the slope, given a vector with horizontal run first and vertical rise next. Example input: x = [10 2];

2 days ago

Solved

Sum of diagonal of a square matrix

If x = [1 2 4; 3 4 5; 5 6 7] then y should be the sum of the diagonals of the matrix y = 1 + 4 + 7 = 12

2 days ago

Answered

Sorting Prime Numbers From an Array of Numbers, Into a New Array

Why not use the primes function? NN=primes(100);

Sorting Prime Numbers From an Array of Numbers, Into a New Array

Why not use the primes function? NN=primes(100);

2 days ago | 0

Answered

Return if No Solution

If A will always be a square matrix, then if the det(A)==0 then return (no solution).

Return if No Solution

If A will always be a square matrix, then if the det(A)==0 then return (no solution).

9 days ago | 0

Solved

Must be in the front row...

You are given a matrix followed by a single number. Your object is to write a script that will shift the matrix around so that ...

9 days ago

Solved

Approximation of Pi (vector inputs)

Pi (divided by 4) can be approximated by the following infinite series: pi/4 = 1 - 1/3 + 1/5 - 1/7 + ... For a given numbe...

9 days ago

Solved

Approximation of Pi

Pi (divided by 4) can be approximated by the following infinite series: pi/4 = 1 - 1/3 + 1/5 - 1/7 + ... For a given numbe...

9 days ago

Solved

Generate Square Wave

Generate a square wave of desired length, number of complete cycles and duty cycle. Here, duty cycle is defined as the fraction ...

9 days ago

Solved

Sum of series VII

What is the sum of the following sequence: Σ(km^k)/(k+m)! for k=1...n for different n and m?

9 days ago

Solved

Sum of series VI

What is the sum of the following sequence: Σk⋅k! for k=1...n for different n?

9 days ago

Solved

Sum of series V

What is the sum of the following sequence: Σk(k+1) for k=1...n for different n?

9 days ago

Solved

Sum of series IV

What is the sum of the following sequence: Σ(-1)^(k+1) (2k-1)^2 for k=1...n for different n?

9 days ago

Solved

Sum of series III

What is the sum of the following sequence: Σ(2k-1)^3 for k=1...n for different n?

9 days ago