Réponse apportée
I want to calculate some function using PSO algoritm. but it doesn't work please help me.
Yu are trying to do element by element multiplication of a vector that has 7 elements (x) by a vector that has 12 elements (G/Gr...

plus de 5 ans il y a | 0

Réponse apportée
Loop answers slightly out from correct values
Are the differences significant? We are unable to check all the numbers that went into the calculations given in the text. The...

plus de 5 ans il y a | 2

| A accepté

Réponse apportée
Help for xtick label
Add this line just above your xticklabels line. hAx1.XTick=[8.3333*10^6 1.25*10^7 1.67*10^7 2.08*10^7 2.5*10^7];

plus de 5 ans il y a | 1

| A accepté

Réponse apportée
Solving nonlinear equations that include integrals with embedded variables
If Dana's suggestion doesn't work, the following non-symbolic approach does: theta0init = pi/2; theta0 = fzero(@intfn, theta0i...

plus de 5 ans il y a | 0

Réponse apportée
how to modify a fitted model
1. To get continuous fit lines, Instead of plot(x1,y1_fit,'r-') do something like x = min(x1):max(x1); y = polyval(p,x); pl...

plus de 5 ans il y a | 0

Réponse apportée
how to developed numerical code for collocation method for linear differential equations
I've just noticed you want to use a collocation method. So you proceed as follows % For method of collocation choose a function...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Solve first order nonlinear ODE
The value of x increases far too quickly, and reaches a value beyond the numerics ability to cope with when x(0) > 2. Works ju...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Finding Minimum value of an anonymous function using fminbnd
You don't need fminbnd to find the minimum of G. Just min(G(na)) will do it (or am I missing something?).

plus de 5 ans il y a | 0

Réponse apportée
I am trying to store every value into a 1D Array from a for loop
It's difficult to tell exactly what you are trying to do, but perhaps the following is close to what you want: ArrayPhi = zeros...

plus de 5 ans il y a | 0

Réponse apportée
How do I fit gaussian function to data whose only information I have is the minimum, maximum and number of data points?
All you can reasonably do is assume the maximum and minimum are a certain number of standard deviations ( say 6 sigma) away from...

plus de 5 ans il y a | 0

Réponse apportée
Check for missing argument or incorrect argument data type in call to function 'fit' - using two 1x15 double arrays as an input argument
Here's a way of fitting a simple exponential curve. However, you definitely don't want to use it to extrapolate! year=[1991,19...

plus de 5 ans il y a | 1

Réponse apportée
How to solve the following equations for Vc(t)?
Can you do it using the differential form of the relationship between Vc and Ic? Something like the following (obviously, you w...

plus de 5 ans il y a | 0

Réponse apportée
How to solve the ODE based 1D heat equation with arbitrary optical heat source term?
Here's a possible solution. I've assumed the temperatures are symmetric about the midpoint. I've extracted data from your file ...

plus de 5 ans il y a | 1

Réponse apportée
How to plot a restoration-based envelope in matlab
Here's a "starter for ten"! I've used approximate time intervals: T = t(end)/10; % period - there seem to be 10 periods...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Converting a maximizing problem into a minimizing program using linprog
Minimize -x. The maximum of x will then be the negative of this.

plus de 5 ans il y a | 0

Réponse apportée
Plot only equilateral triangles
Here's an alternative approach: e = 0.01; for i = 1:10 xc = rand(1); yc = rand(1); r = rand(1); while r < e/sq...

plus de 5 ans il y a | 1

Réponse apportée
Fixed-bed adsorption
Do you just need a finer mesh? See: epsilon = 0.62; % Voidage fraction Kc = 4.5542e-5; % Mass Transfer Coefficient Kl = 2...

plus de 5 ans il y a | 2

| A accepté

Réponse apportée
Solving LTID system recursively
Matlab indexing begins at 1, so you can't have y(-2), y(-1), y(0) etc. Shift your indexing. y(1) = 2; y(2) = 3; for k = 3: l...

plus de 5 ans il y a | 0

Réponse apportée
How to divide each column in array 1 by corresponding column in array 2 and put answers in new array, array 3
Try Transmittance = SPFPMTSignal ./ SkinPMTSignal Notice the dot before the backslash. It means element by element division.

plus de 5 ans il y a | 0

Réponse apportée
Write a matrix to txt file
Try this: gamma =[1.85506173843200, 1.00229272121327; 1.74935758533076, 1.00727718522748; 1.54993783446447, 1...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
How to solve an equation with the variable on both RHS and LHS?
Like this for example (obviously, you will need to replace my arbitrary data with your actual data): OF = 2.4; wbar = linspace...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
How can I generate random Student t numbers?
The easiest way is to use the Statistics toolbox. If you don't have access to that then search Matlab's File Exchange, where th...

plus de 5 ans il y a | 0

Réponse apportée
Plot an equation: variable inputs
Just a slight modification of the routine in your previous post is needed! Cfn = @(CdB) 10.^(CdB/20); Mfn = @(C,T) (C./(1-T.*(...

plus de 5 ans il y a | 0

Réponse apportée
Why is this break not executing for the summation of pi
PrevSum/pie should tend to 1. abs(PrevSum - pie) should get smaller than 10^-8. Try pie = 0; k = 0; err = 1; while err>10^...

plus de 5 ans il y a | 0

Réponse apportée
Solve ODE for variable domain
So you would then call your ode with something like: [x,Y] = ode45(@nozzlesinglebobb, xspan, Y0,[],xstartconica,xfineconica,Ral...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
3/8 Simpson's Rule
The result of integrating of your function between 0 and 1 is: I = (exp(1)^2*(2*sin(5)-5*cos(5)) + 5)/29; so relative error is...

plus de 5 ans il y a | 1

Réponse apportée
Remembering Variables In for Loop
for i=1:no_of_values x(i)=input(['Enter the value of x_ ',num2str(i)]); y(i)=input(['Enter the value of y_ ',num2str(...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Inline to Anonymous Function
Simply replace your x = inline... etc expression with x = @(t) 5*sin(2*pi*1*t).*exp(-.4*t);

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Received Power Vs Distance
If Z is distance then you should probably have Pr=Pt*Gt*Gr*lambda^2./(16*pi^2.*Z.^2); Note the position of the parentheses. I...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
plot lines not showing up
You were overwriting P all the time, instead of storing all the values: R=287; r=1.4; Mach=[2:0.5:6]; for i=1:9 M=Mach(...

plus de 5 ans il y a | 0

Charger plus