Community Profile

photo

Alan Stevens


Last seen: Today Attivo dal 2020

Statistics

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

Visualizza badge

Content Feed

Visto da

Risposto
Inconsistent results from "int" function
You can express '(y*(2*x + y)^2)/192 as (x*y*(x + y))/48+y^3/198 As far as the integral is concerned y is a constant, so the t...

1 giorno fa | 1

| accettato

Risposto
Boole's Approximation
You are using Boole from -1 to 1, but the "exact" from 0 to pi. (You should plot G against x to see why your "exact" integral w...

4 giorni fa | 0

Risposto
I'm trying to solve a system of differential equations using Euler's method, but I don't know what the problem is with my code. If you can correct me the problem
Don't confuse the number 1 with lower case l a= 0; b= 2; delta_x =0.5; y1(1) = 4; y2(1) = 6; n= (b-a)/delta_x + 1 ; x(1)...

4 giorni fa | 0

| accettato

Risposto
How to add one sgtitle per row of suplots
Try subplot(2,3,1) scatter(62,VWE3a_diff,50,'MarkerEdgeColor','[0 0 0]','MarkerFaceColor','[0 0.5 1]','Marker','o') title('DM...

8 giorni fa | 0

Risposto
How to add one sgtitle per row of suplots
Here's a quick and dirty way: x = 0:0.01:2*pi; for i=1:6 y = sin(x+i*pi/4); subplot(2,3,i) plot(x,y) ...

8 giorni fa | 0

Risposto
How do you solve a System of 11 Non-Linear Equations Inter-linked to one another?
Here's a possible logic (though I seem to find negative values for U): U1 = 500; U2 = 500; % Initial guesses U0 = [U1 U2]; ...

10 giorni fa | 0

Risposto
Title in maths symbol and title as legend on each plot on different locations.
More like this? %% Set up the data (just enough to need a large legend and to show variety) t = linspace(0, 1, 11); x = linsp...

12 giorni fa | 0

Risposto
How to show Kinetic energy,potential energy at given ditance
Do you mean something like this: Tf=20; theta=60; height=5000; angle = 45; g=9.81; velocity=(g*Tf)/(2*sind(theta)); figur...

13 giorni fa | 0

Risposto
Summation for every value of "n" (or summation with looping)
Like so: B=7.5; % angle value fn = @(n) (1+2*cos(n*B)).^5/2; n=1:50; Qn = fn(n); Q = sum(Qn); Pr= 395; P1= Pr/Q; disp(P1...

14 giorni fa | 1

| accettato

Risposto
Implementing while loop in Heun's Method
Here's a rough and ready way (I'll leave you to implement Heun's method): f = @(H) -0.06*sqrt(H); H = 4; t = 0; dt = 0.1; %...

16 giorni fa | 2

Risposto
How to explain a difference in solutions of integrals between MATLAB and MAPLE?
This is what I get in Maple:

18 giorni fa | 0

Risposto
I want to put arrows on each of the lines parallel to x-axis using LOOP
Like this? p = 0.02:.07:1; plot([0; 1],[p; p], 'color','b'); hold on %q = 0.2:.2:1; xx = [0.5 0.57]; ...

20 giorni fa | 0

| accettato

Risposto
How can I plot this signal?
Like this? gm = 0.04; RL = 10000; CL = 10^(-9); f = logspace(-1,2); Av = (-gm*RL)./(1 + RL*CL*f*1i); %magnitude subplot...

26 giorni fa | 0

| accettato

Risposto
Hey so I am trying to code an ellipse and I was confused about the placement of my plot. Should it be before the for loop or after?
Something like this? (I've commented out your meshgrid commands as they just confuse the plot and I'm not at all clear why they ...

26 giorni fa | 0

Risposto
Using Euler's Method for projectile motion
A little more like this? (I've used arbitrary values for initial conditions etc.) N = 200; % points to be taken g = 9.8; % acc...

26 giorni fa | 0

| accettato

Risposto
need plot a graph using Euler's method for both numerical and analytical
f = a + (2 - 0.4*a) * x(i) / r^2 * pi; % x(i) not just x. % Also take note of the other comments above.

29 giorni fa | 1

Risposto
How can I create a loop to show a table with number of iterations and its roots in secant method?
Possibly like this (though using a while loop would be better): f=@(x) exp(0.5*x)+(5*x); x(1)=0.8; x(2)=0.7; tol=0.0001; ...

circa 2 mesi fa | 0

| accettato

Risposto
Condition for output result
Instead of x1 = x0+B; how about x1 = max(min(x0+B,5.0),0);

circa 2 mesi fa | 0

| accettato

Risposto
Why is my loop not ending?
Shouldn't dp(i+1)= ((6*m(i+1))/(pi*row))^(1/3); be dp(i+1)= -((6*m(i+1))/(pi*row))^(1/3); i.e. have a negative sign in front...

2 mesi fa | 0

Risposto
Explicit solution can not be found using dsolve of second order differential equation
Do you have a reason to believe there is an analytical solution to this? It is simply solved numerically, as follows: X0 = [1,...

3 mesi fa | 0

| accettato

Risposto
i am trying to add a legend for the 0.2% offset line onto the graph, but when i run this, the previous three legend just disappear.
Just put '0.2 offset line' as a fourth item in your other legend command.

3 mesi fa | 0

| accettato

Risposto
Minimizing an equation to 0
Try fminsearch

3 mesi fa | 0

Risposto
Solving for two variable.
In that case one way is to take logs of both sides to get: log(I) = log(I0) + q/(n*k*T)*U then do a best-fit straight line...

3 mesi fa | 0

| accettato

Risposto
I couldn't plot the function because it seems vector length isn't same, please help me in it.
Try changing n = 100 for i = 1:n to n = numel(time); for i = 1:n-1

3 mesi fa | 0

Risposto
How to plot an array graph from a 'for' loop?
Try multiplying i by delta_t in the plot command x(1) = 1; delta_t = 0.1; n = 100; for i = 1:n hold on grid ...

3 mesi fa | 1

| accettato

Risposto
Display text label on top of grouped bar plots
See answer at your earlier question.

3 mesi fa | 0

| accettato

Risposto
Solving coupled second order differential equations
Something like this? m1 = 10; m2 = 20; c = 30; k = 5; tspan = [0 1]; ic = [...

3 mesi fa | 0

| accettato

Risposto
How to create an objective function c(t) to use fminserch , struggle with the summatoin , i used the following code for the optimization but it doesn't seem to work
Do you mean something like this: KT0 = [1, 10]; % initial guesses [KT, C] = fminsearch(@FN, KT0); K = KT(1); T = KT(2); d...

3 mesi fa | 1

Risposto
Generate diagram in linear scale
See help polyval

3 mesi fa | 0

Carica altro