Answered

Solve system of equations where variables are xby1 column

x=A\b%where A is matrix of coefficients and b is a column vector of answers

Solve system of equations where variables are xby1 column

x=A\b%where A is matrix of coefficients and b is a column vector of answers

etwa 2 Stunden ago | 0

Answered

Matlab Solve a system of equations for a set of data

You could just solve Ax=b (A\b): E=73*10^9; v=0.33; ey28=-1*10^-6; ex28=-3*10^-6; b=[v*E*(ex28+ey28)/(1+v)/(1-2*v)+E*ex28/...

Matlab Solve a system of equations for a set of data

You could just solve Ax=b (A\b): E=73*10^9; v=0.33; ey28=-1*10^-6; ex28=-3*10^-6; b=[v*E*(ex28+ey28)/(1+v)/(1-2*v)+E*ex28/...

etwa 2 Stunden ago | 0

Answered

Why I get ans = logical 1

Much easier way: A=normrnd(0,1,[100,1]); [~,~,a]=histcounts(A,[-10,-.9957,0,.9957,10]); b=[-1.493;-0.497;0.497;1.493]; Aq=b(...

Why I get ans = logical 1

Much easier way: A=normrnd(0,1,[100,1]); [~,~,a]=histcounts(A,[-10,-.9957,0,.9957,10]); b=[-1.493;-0.497;0.497;1.493]; Aq=b(...

etwa 5 Stunden ago | 0

Answered

I am not sure how to do this coding, can you please help!!

b = 3500; Balance=3500; r = 1.06; rr=1.05; for i = 1:30 Balance = Balance*r+b*rr^i; end

I am not sure how to do this coding, can you please help!!

b = 3500; Balance=3500; r = 1.06; rr=1.05; for i = 1:30 Balance = Balance*r+b*rr^i; end

etwa 6 Stunden ago | 1

Answered

Read a column as numbers

This works just fine for me. data=readmatrix('Data.csv');

Read a column as numbers

This works just fine for me. data=readmatrix('Data.csv');

etwa 8 Stunden ago | 0

Answered

double loop formation question

for j=1:52 jj=j; for i = 1:30 depth_week_j(:,:,i) = GWdepth(:,:,jj); jj = jj + 52; end me...

double loop formation question

for j=1:52 jj=j; for i = 1:30 depth_week_j(:,:,i) = GWdepth(:,:,jj); jj = jj + 52; end me...

etwa 10 Stunden ago | 0

Answered

Value dependant sort of matrix rows

sorted_M8=M8'; sorted_M8(ismember(M8',8))=M8(:,1); sorted_M8=sorted_M8'; sorted_M8(:,1)=8;

Value dependant sort of matrix rows

sorted_M8=M8'; sorted_M8(ismember(M8',8))=M8(:,1); sorted_M8=sorted_M8'; sorted_M8(:,1)=8;

etwa 10 Stunden ago | 0

| accepted

Answered

Need help with plotting a complicated for loop

function y=f(x) for i=x if i>2 y=x.^2;%you are reassigning y every iteration, your y will be ...

Need help with plotting a complicated for loop

function y=f(x) for i=x if i>2 y=x.^2;%you are reassigning y every iteration, your y will be ...

etwa 22 Stunden ago | 0

Answered

How can I eliminate the NaN?

x = input('Angle in Radians:'); d=cos(x); f=1; difference = d - f; difference = abs(difference); threshold = .0001; n = 0;...

How can I eliminate the NaN?

x = input('Angle in Radians:'); d=cos(x); f=1; difference = d - f; difference = abs(difference); threshold = .0001; n = 0;...

etwa 22 Stunden ago | 0

| accepted

Answered

Typing a long and complicated equation

z=@(y)2*pi*(sqrt((44.56-y)/.16)+1).*sqrt(1+(1./(.32-.32*(sqrt((44.56-y)/.16)+1))).^2); y=0:.01:10;%have no idea what you are in...

Typing a long and complicated equation

z=@(y)2*pi*(sqrt((44.56-y)/.16)+1).*sqrt(1+(1./(.32-.32*(sqrt((44.56-y)/.16)+1))).^2); y=0:.01:10;%have no idea what you are in...

ein Tag ago | 0

Answered

For loop for this ?

A simple matrix would work much better. Vcd=125*(ones(3,10).*[1.2,1.3,1.4]').^(1:10);%this is 10 years, each column with the di...

For loop for this ?

A simple matrix would work much better. Vcd=125*(ones(3,10).*[1.2,1.3,1.4]').^(1:10);%this is 10 years, each column with the di...

ein Tag ago | 0

Answered

bisection method with log

Once you graph your function, you see there are 4 roots. Using the bisection method to find the numerical roots should now be ea...

bisection method with log

Once you graph your function, you see there are 4 roots. Using the bisection method to find the numerical roots should now be ea...

ein Tag ago | 0

Answered

How do put the values within a cell in a matrix?

dff1=wholedff{1}; dff2=wholedff{2}; ... but why would you want to do that? That is why we do indexing so we do not have to ha...

How do put the values within a cell in a matrix?

dff1=wholedff{1}; dff2=wholedff{2}; ... but why would you want to do that? That is why we do indexing so we do not have to ha...

ein Tag ago | 0

Answered

Simpson's 1/3 Rule Implementation Issue (Code Provided)

The following function might help. function o = simp(a,b,f,n) x=linspace(b,a,n+1); o=0; for k=1:n xx=[x(k);(x(k)+x(k+1)...

Simpson's 1/3 Rule Implementation Issue (Code Provided)

The following function might help. function o = simp(a,b,f,n) x=linspace(b,a,n+1); o=0; for k=1:n xx=[x(k);(x(k)+x(k+1)...

2 Tage ago | 0

Answered

Setting variable names inside function based on input arguement in MATLAB

function ans=testNum(z) str = ''; NaN; while isnan(ans) input([str, 'Enter a value for ',z,': ']); ...

Setting variable names inside function based on input arguement in MATLAB

function ans=testNum(z) str = ''; NaN; while isnan(ans) input([str, 'Enter a value for ',z,': ']); ...

2 Tage ago | 0

| accepted

Solved

ZigZag - 01

Given a matrix, return the elements that are on the Z form of the matrix. For example - a=[1,2,3; 4,5,6; 7,8,9] ...

2 Tage ago

Solved

Seconds

Given the number of seconds after 12 am, find the time in the given format (12/24). If the format is not mentioned, use 24-ho...

2 Tage ago

Answered

Are there any functions that will return the index of the last string in a cell of strings?

find(ismember(cell,'a'),1,'last');

Are there any functions that will return the index of the last string in a cell of strings?

find(ismember(cell,'a'),1,'last');

2 Tage ago | 1

| accepted

Answered

How do I call a script inside a function?

Why not just use functions? I only use scripts when I am working in the workspace. Unless you are going to call a function more ...

How do I call a script inside a function?

Why not just use functions? I only use scripts when I am working in the workspace. Unless you are going to call a function more ...

3 Tage ago | 0

Answered

Applying a string of user inputs within a while-loop

Recommend breaking while loop with if statement: while 1 angle=input(['Enter the angle of trajectory [degrees] : ']); ...

Applying a string of user inputs within a while-loop

Recommend breaking while loop with if statement: while 1 angle=input(['Enter the angle of trajectory [degrees] : ']); ...

3 Tage ago | 1

Answered

Matrix dimensions must agree

Several problems I have noticed: a = 0.4; f = 10^6; w = 2*pi*f;%scalar no need for . I0 = 1; b = (0.4/2); mu0 = 4 * pi * 1...

Matrix dimensions must agree

Several problems I have noticed: a = 0.4; f = 10^6; w = 2*pi*f;%scalar no need for . I0 = 1; b = (0.4/2); mu0 = 4 * pi * 1...

3 Tage ago | 0

Answered

Sorting a large 3 column data set

If I understand you correctly, can you not just subtract off a constant from both x and y coordinates to reset them to where you...

Sorting a large 3 column data set

If I understand you correctly, can you not just subtract off a constant from both x and y coordinates to reset them to where you...

3 Tage ago | 0

| accepted

Answered

How can i get the trigonometric function of cos and sin of a variable

Why are the users not entering numbers instead of character arrays? T1 = input('Introduce the value of Theta for row 1 = ');

How can i get the trigonometric function of cos and sin of a variable

Why are the users not entering numbers instead of character arrays? T1 = input('Introduce the value of Theta for row 1 = ');

3 Tage ago | 0

Answered

The kinetic energy of a moving car object is KE=1/2mv^2

function energy = KE(m,v) energy= %put your code here end

The kinetic energy of a moving car object is KE=1/2mv^2

function energy = KE(m,v) energy= %put your code here end

3 Tage ago | 0

| accepted

Answered

Functions and For Loops For Polynomials

Too bad you can't use polyval(). This might get you started. function e=evalPoly(p,a) x=1; e=0; for k=1:length(p) e=e+p...

Functions and For Loops For Polynomials

Too bad you can't use polyval(). This might get you started. function e=evalPoly(p,a) x=1; e=0; for k=1:length(p) e=e+p...

3 Tage ago | 0

Answered

consider preallocating for speed

No for-loop needed. No preallocation needed here. theta_2=1:360; th_2=theta_2*pi/180;%you could use cosd() and not need to con...

consider preallocating for speed

No for-loop needed. No preallocation needed here. theta_2=1:360; th_2=theta_2*pi/180;%you could use cosd() and not need to con...

4 Tage ago | 0

Answered

How would I divide a 206x1 double it into 5 equal sections and average the values

I am not exactly sure what you mean. If you have matrix (M -206x1) and you want to find the mean of different groupings, then: ...

How would I divide a 206x1 double it into 5 equal sections and average the values

I am not exactly sure what you mean. If you have matrix (M -206x1) and you want to find the mean of different groupings, then: ...

4 Tage ago | 0

Solved

Pandigital Factors (Based on Euler 491)

A Pandigital Number is a number containing all of the digits from 0-9 inclusive, with the added stipulation that it does not hav...

4 Tage ago