Matrix Question for 12*12 matrix
Supposing M is the 12x12 matrix, then M([1,2,4],:)=[]; M(:,[1,2,4])=[]; should remove the appropriate rows and columns.

11 days ago | 0

| accepted

Cant get my loop to work
Replace your k loop by for k=1:size(IC,1) [V, CT] = ode45(@fn, Vspan, IC(k,:)); figure; plot(V,CT(:,1),V,CT(:,2),V,CT(:,3...

11 days ago | 0

| accepted

Error - Inputs must be floats 'ode45'
Like so (Note: no need for syms): a = 0.2; c = 1; b = (2*c/(1-a)); inital(1)=1; inital(2)=1; l = @(t,s) [s(1)*(1-s(1))*(a+...

11 days ago | 1

| accepted

Need help on solving this bisection method question
You really don't need any symbolic parameters here; and you had the logic with a and b the wrong way round! Try f = @(x) -2*x....

12 days ago | 1

| accepted

*Matrix dimensions must agree error*
Look up .* (i.e. dot*), ./ and .^ for element by element actions. Replace the later part of your code by x=linspace(0.5,1);...

12 days ago | 1

| accepted

Incorrect Intersection Output of Two Lines
After your two for loops put the following intersectfn = @(t) interp1(tklaus,xk,t) - interp1(thans,xh,t); t0 = 50; % Initial ...

12 days ago | 1

How to solve a equation iteratively?
Look at the fzero function. Assuming you know P as a function of K, then with an initial guess for K K0 = ...' % initial gue...

12 days ago | 0

| accepted

for loop for variables
You probably want o = 90; not 0 = 90; Also, Matlab indexing starts at 1 not zero, so, perhaps, t = 1:101, then xd(t) = sin(wd*...

12 days ago | 0

| accepted

Fitting gaussian exponential to logscale
The logs of the y values are negative, whereas your function will return positive values only! You are probably better off tryin...

12 days ago | 1

| accepted

Trying to code from Polymath
Here's a basic MATLAB version. % Initial conditions Ca0 = 2; Cb0 = 4; Cc0 = 0; Cd0 = 0; T0 = 800; IC = [Ca0 Cb0 Cc0 Cd0...

12 days ago | 0

| accepted

How do you solve the non-growth rate of yeast using non-linear regression analysis?
You can do it as follows. Notice that there are, in effect, only four paramters to fit: x = 0:0.5:5; % mg/L k = [0, 0.22390...

12 days ago | 1

can ı plot this chart with a given equation?
Here's a starter. You can add the other equations and labelling V = @(S) 0.349109 + 6.00940*S + 0.047467*S.^2; S = logspace(-...

13 days ago | 1

| accepted

create tuples of values in array
How about x=[x1,x2,x3,..,xn]; y=[y1,y2,y3,..,yn]; xy = [x; y]; X = xy(1,:); Y = xy(2,:);

13 days ago | 0

Problems with the legend function.
You might have to change the plot order a little. More like this perhaps: M=1000; x=linspace(-11,15,M); y=linspace(-7,11,M);...

13 days ago | 0

How can I solve the determinant of large-sized symbolic matrix: det(A)=0?
Set the diagonals of D to be just, u, say. With vpasolve you get 20 numerical values of u almost as quickly as 5. You can then...

13 days ago | 0

My IF function for a set of data is not working.
You could replace if Da<48 X=32-25*log10(LUA-Y) else X=Grx end by the fol...

13 days ago | 0

How do i replace Euler's method with ode45?
Here's one way. I've simplified the data input - you can add the bells and whistes! % A script to animate the motion of the sim...

14 days ago | 0

| accepted

dsolve - Warning: Unable to find symbolic solution.
Why not just solve them numerically: % Parameters tau = 0.138; % dimensionless kinetic parameter delta = 9.9; %...

15 days ago | 0

| accepted

How to increase maximum number of iterations in a 'for' loop, when in the loop?
Use a while loop instead while (norm((x-T),1) > Tolerance) ...etc end

15 days ago | 1

| accepted

Lagrange Interpolating Polynomial Function
Matlab indexing starts from 1 not zero. Also, in array(k) = array(k) * (f(x)-x(i))/(x(k)-x(i)) you should have f(x(i)) not ...

15 days ago | 0

Integrating Acceleration Data Matlab
Try v = cumtrapz(X2(:,1),X2(:,2)); plot(X2(:,1),v)

15 days ago | 0

| accepted

Index exceed matrix dimensions.
Do you just need j = 1; before the last for k=dt:dt:29*dt loop?

15 days ago | 0

Ode45 initial conditions iteration
Like so ... [X Y] = ... for r=1:length(Rad_speed)%freq of harmonic fluctuations, rad/s [t,q]=ode45(duf,Time,[X Y]); [...

16 days ago | 0

| accepted

Outputs of the ode45 is not matching with the known results.
Use tspan = 0:-0.001:-1; to get the correct values for negative values of t.

16 days ago | 1

| accepted

Conditional variables with running ODE45
Yes, but rearrange the coding as follows: tspan = [0:4:200]; y0 = [0.95 0.05 0]; [t,y] = ode45(@(t,y)odefcn(t,y),tspan,y0); ...

16 days ago | 0

| accepted

Index in position 1 is invalid- attempting to perform Laplace's equation
In your loops, 0.1i and 0.1j will result in non integer values for most values of i and j. Indices in T(i,j) etc must be intege...

16 days ago | 0

how to display figures on a plot
str = {['mean_x = ',num2str(mean(x))],...etc} for example. Type: doc num2str in the command window.

16 days ago | 0

| accepted

How to plot h(y/x)? where gamma coefficient =0.5772
Use function expint.

17 days ago | 0

ODE stop integration with imaginary numbers
Are you sure you have the units right here when dMdt <=0? if dMdt > 0 drdt=sqrt(2*g*(h-hmin)); else drd...

17 days ago | 0

| accepted