Beantwortet
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...

fast 6 Jahre vor | 0

Beantwortet
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...

fast 6 Jahre vor | 2

| akzeptiert

Beantwortet
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];

fast 6 Jahre vor | 1

| akzeptiert

Beantwortet
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...

fast 6 Jahre vor | 0

Beantwortet
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...

fast 6 Jahre vor | 0

Beantwortet
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...

fast 6 Jahre vor | 0

| akzeptiert

Beantwortet
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...

fast 6 Jahre vor | 0

| akzeptiert

Beantwortet
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?).

fast 6 Jahre vor | 0

Beantwortet
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...

fast 6 Jahre vor | 0

Beantwortet
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...

fast 6 Jahre vor | 0

Beantwortet
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...

fast 6 Jahre vor | 1

Beantwortet
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...

fast 6 Jahre vor | 0

Beantwortet
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 ...

fast 6 Jahre vor | 1

Beantwortet
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...

fast 6 Jahre vor | 0

| akzeptiert

Beantwortet
Converting a maximizing problem into a minimizing program using linprog
Minimize -x. The maximum of x will then be the negative of this.

fast 6 Jahre vor | 0

Beantwortet
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...

fast 6 Jahre vor | 1

Beantwortet
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...

fast 6 Jahre vor | 2

| akzeptiert

Beantwortet
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...

fast 6 Jahre vor | 0

Beantwortet
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.

fast 6 Jahre vor | 0

Beantwortet
Write a matrix to txt file
Try this: gamma =[1.85506173843200, 1.00229272121327; 1.74935758533076, 1.00727718522748; 1.54993783446447, 1...

fast 6 Jahre vor | 0

| akzeptiert

Beantwortet
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...

fast 6 Jahre vor | 0

| akzeptiert

Beantwortet
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...

fast 6 Jahre vor | 0

Beantwortet
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.*(...

fast 6 Jahre vor | 0

Beantwortet
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^...

fast 6 Jahre vor | 0

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

fast 6 Jahre vor | 0

| akzeptiert

Beantwortet
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...

fast 6 Jahre vor | 1

Beantwortet
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(...

fast 6 Jahre vor | 0

| akzeptiert

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

fast 6 Jahre vor | 0

| akzeptiert

Beantwortet
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...

fast 6 Jahre vor | 0

| akzeptiert

Beantwortet
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(...

fast 6 Jahre vor | 0

Mehr laden