photo

Alan Stevens


Last seen: Today Attivo dal 2020

Followers: 1   Following: 0

Statistica

  • 36 Month Streak
  • Guiding Light
  • Knowledgeable Level 5
  • First Answer

Visualizza badge

Feeds

Visto da

Risposto
Something doesn't work for me in fit
Here's a fit using fminsearch (I just used a quick but coarse approach- the code can be made much cleaner!). v=[10 30 5...

5 giorni fa | 0

Risposto
Plotting while skipping the middle point in a vector
Something like this? tic v1 = [1 2 3 4 5 8 9 10 20 21 22 30 31 32]; dv = diff(v1); ix = find(abs(dv)>1); v = []; s2 = 0; f...

20 giorni fa | 1

| accettato

Risposto
help with nested loop and plot
Here's another way, still using nested loops: n= 101; x = linspace(-100, 100, n); y = linspace(-100, 100, n); [X, Y] = meshg...

21 giorni fa | 0

| accettato

Risposto
How to integrate an implicit acceleration function to a fitting pair of graphs of velocity and displacement
Look up ode45 for the integration (for a fixed set of parameters) and fminsearch for fitting the parameters to known data.

circa un mese fa | 0

Risposto
Brush: How can I change the font color of the displayed X and Y range?
Select the Property Inspector, select the text, choose a color. (The following code is just to get the image uploaded) I=imrea...

circa 2 mesi fa | 0

Risposto
how to use an integral function inside a for loop? i need to find the value of function that chages as i chages .then using this values i need to find another integral.
Are you looking for something like this? r0 =0.1; u =[1:7]'; Q =zeros(length(u),1); E =zeros(length(Q),1); Q = @(x)0.023*(r...

circa 2 mesi fa | 0

Risposto
Simpson integral - problem with writing the formula
Should be x(i) etc. not a(i). Also be careful with brackets. % Test 1 a = 0; b = 1; n = 10; f = @(x)1-x+x.^3; I = simpson(f...

circa 2 mesi fa | 0

Risposto
How do I apply iteration method to an integral?
Look up help on function fzero.

3 mesi fa | 1

| accettato

Risposto
How can I plot a reflection angle of a projectile in a kinematics model? Overlay projectile motion plots?
Surely you only need to reverse the x-velocity? imperialBallVelocity = 52.20; release_angle = 42; release_height = 64.2; %Ki...

3 mesi fa | 0

Risposto
Why am I receiving this error?
You have 4 layers layer_angles = [45, -45, -45, 45]; but data for only three mid_plane_strains = [0.05, 0.00, 0.00]; % Mid-p...

3 mesi fa | 0

Risposto
Function g Returns Only 2 Values Instead of Array - Vectorized Operation Issue in MATLAB
You have g as a function of x2, but x2 doesn't appear on the right-hand side!

3 mesi fa | 0

| accettato

Risposto
Solve for x with given equation
Look up the help on function fzero. And don't forget that Matlab doesn't recognise implicit multiplication. x(...) should...

3 mesi fa | 0

Risposto
power method with rayleigh coeff
Make sure you call the function with the arguments in the same order as those defined in the function! A=[4 1 -1 0;1 3 -1 0;-1 ...

3 mesi fa | 0

| accettato

Risposto
Fill area between two vertical curves
Like this: value = [186.7646 198.4115 191.1406 180.8430 175.7136 ... 167.7459 151.2865 144.5964 139.8148 139.4305 188.2865 204...

4 mesi fa | 2

| accettato

Risposto
Simplificar el resultado como valor numerico
Why not simply: p1=[2;3] ; x0_1=@(theta) [cos(theta); sin(theta)]; % =[x1*x0; x1*y0] y0_1=@(theta)[-sin(theta); cos(theta)];...

4 mesi fa | 1

Risposto
Optimizing code for HAC Weight matrix generation - How to be faster?
Try replacing the loops with something like this: i = (1:size(Weight_correlation,1))'; j = 1:size(Weight_correlation,2); c = ...

4 mesi fa | 0

Risposto
How to a create a label at the bottom of a vertical line?
Like this? x = linspace(0,6,100); y = exp(x); plot(x,y) xline(4.5,'-',{'Acceptable','Limit'}, 'LabelVerticalAlignment', 'bot...

4 mesi fa | 0

| accettato

Risposto
Secant method Nan Error
You haven't updated error in your while loop. Try including something like error = abs(X0-X1);

4 mesi fa | 0

| accettato

Risposto
Function error in ODEs RK4 method, solving 6 unknowns
It works for me (I've commented out the fprint statements in the code below - but it works with them in!): global CDin psi thet...

5 mesi fa | 0

| accettato

Risposto
I keep getting the error using '/'.
Try mu_ratio=(1-(vol_frac(c,1)/0.605).*((particle_ratio(c,1)).^1.2)).^(-1.5125); Notice the dots! .* .^ Difficult to be...

5 mesi fa | 0

Risposto
Plateau followed by one phase decay
Like this? x = 0:0.5:20; % time in seconds Y0 = -0.6; % signal baseline value Plateau = -1; % singnal plateu after trigger/st...

5 mesi fa | 1

Risposto
Radiation view factor using Monte Carlo
I think you probably need cos(theta), rather than theta, to be linearly spaced.

5 mesi fa | 0

Risposto
How to fix a syntax in the oscillator's plot code?
Like this (both x_1 and x_2 are contained in y) T0 = 10; omega0 = 1; M = 1; F = 1; x_1 = 0; x_2 = 0; x_0 = [x_1 x_2]; ts...

5 mesi fa | 0

| accettato

Risposto
ODE45has long runtime and graph will not plot
Here's my attempt to make sense of your equations tauspan = 0:100:10000; % p0 = [0.5 0.5 0 0]; % dp1dt = -rf + rr % dp2...

6 mesi fa | 0

Risposto
Two graphs in the same plot, why?
Something like this data = xlsread('sunHoursInTrollhattan.xlsx'); mins = data(:,1)*60 + data(:,2); plot(1:12, mins,'o'),grid ...

6 mesi fa | 0

| accettato

Risposto
Two graphs in the same plot, why?
You have the hours as one plot and the minutes as the other! Turn the data into all minutes, or all hours first.

6 mesi fa | 0

Risposto
Could anyone help me in fixing the problem in my code for solving the initial value problem numerically: y'=y^2, y(0)=1?
Here's an attempt using fminsearch. I don't know anything about the Obreschkoff method, so couldn't say if your equations are...

6 mesi fa | 0

| accettato

Risposto
I get this message(Attempted to access F(5); index out of bounds because numel(F)=4.) when I run the code below..
In fsode you try to use F(7) when calculating F(5), before you have calculated F(7)!

6 mesi fa | 1

| accettato

Risposto
Laser Rate Equation Modelling
Like this? (Look at lines 27, 28 and 38) %Script % Define model parameters temperature = 25; wavelength = 1.312e...

6 mesi fa | 0

Risposto
Determine the coordinates of the nodes forming the outermost circle
Here's an alternative way: nodes = importdata("nodes.mat"); figure plot3(nodes(:,1),nodes(:,2),nodes(:,3),'b.','Markersize',1...

6 mesi fa | 0

Carica altro