Answered
adding numbers in an M file
sum(f) (after the loop)

15 years ago | 0

Answered
Matrix of Galois Field Elements
You must have a different version of MATLAB than I do (2010b). The error message I get is: ??? Error using ==> gf.gf at 66 X ...

15 years ago | 1

| accepted

Answered
Solving a differential equation
If your equations contain only linear combinations of the derivatives, you could formulate it as a mass matrix problem |M(t,y)y'...

15 years ago | 1

| accepted

Answered
evaluate expression
It would be simpler to provide |y| and solve for |x|: y = -1:0.01:1; x = y.*exp(- (1-y)./(A*y)*B ); In plotting this, y...

15 years ago | 0

Answered
Double sigmoid fit
Here is an example of how you could use |cfittool| to create a sigmoid fit. First, enter these commands in the Command Window. ...

15 years ago | 0

| accepted

Answered
Plot symbolic polynomial
This plots the real part of |y| against |x|: syms x y ezplot(y-x^2-1i-2) Of course, it looks just the same as syms x y ez...

15 years ago | 0

| accepted

Answered
Do you suffer from keyboard latency in this forum?
Here is an approach that I hope will make life easier for people with keyboard latency that is not too extreme. I used it to wri...

15 years ago | 1

Answered
Solving a differential equation
I have been floundering a bit with this problem, but now I see what you need: a variable z = [y; g] with y'(t) = (g-a)*y(t) ...

15 years ago | 1

Answered
Apply colormap to plot(x,y)
To create the colormap, you could use |spectrumRGB| in <http://www.mathworks.com/matlabcentral/fileexchange/7021 Spectral and XY...

15 years ago | 1

| accepted

Answered
Availability PDF
A PDF doesn't have to be restricted to 100% (or 1, as I usually think of it) - as long as the integral of the PDF is 1, it's o.k...

15 years ago | 0

Answered
Combining 2 different models
out1 = model1(in1); out2 = model2(out1,otherVariables);

15 years ago | 0

Answered
Solving a differential equation
If I understand your question, you have a delay differential equation with one variable y(t), and your equation has the form y'(...

15 years ago | 0

Answered
How to avoid NaN with numerical integration (quadrature)
If you set a debugging breakpoint at the call where the warning occurs, then Futpd(LimInf_) ans = NaN *EDIT*: The ...

15 years ago | 1

| accepted

Answered
Second derivative of Gaussian function
Sure: syms yo A w X c Gaussian=yo+A/w*exp(-((X-c)/w)^2); diff(Gaussian,w,2) I have cleaned up some redundancy in your expres...

15 years ago | 0

Answered
A problem using ode23s and lsqcurvefit
You need to learn some debugging techniques. Look at <http://www.mathworks.com/help/techdoc/matlab_env/brqxeeu-151.html Preventi...

15 years ago | 0

Answered
pde solver
This would be hard to solve numerically because it is ill-defined. Any function of the form |f(c*z-b*t)| is a solution.

15 years ago | 0

Answered
Minimization falls in wrong minima
This problem seems under-constrained. A rotation matrix |R| should satisfy |R.' = inv( R )| and should have a total of three ind...

15 years ago | 0

| accepted

Answered
Output values from a loop
Do you use the MATLAB Editor? You should because it has some very useful diagnostics. Look at the right margin of the editor and...

15 years ago | 0

Answered
Create plot with specified handle?
I doubt it. If you could create one plot with handle |32|, you could create another, and then it wouldn't be unique any more. Th...

15 years ago | 0

Answered
Odd triangles using Matlab's contour and contourf functions
I think your main problem is that there aren't many data, so it is hard to make nice contours out of it. Look at the bit-mapped ...

15 years ago | 0

| accepted

Answered
plot transperant 3d sphere
As you suggested yourself, you can use |sphere| to generate the sphere: r = 24.04; [x,y,z] = sphere(50); x0 = 16.5; y0 = 14.8...

15 years ago | 5

Answered
Any idea on how to create a n by n square matrix.
Use |meshgrid|: npanels=3; %number of panels dP=2.4/npanels; %equal length panels P=[-1.2+(2.4/npanels)/2:dP:1.2-(2.4/npa...

15 years ago | 2

Answered
How to multiply a vector with each column of a matrix most efficiently?
I don't find that. If my input is clear t=(1:1000)'; A=rand(length(t),200); [n,m] = size(A); %% 1. Looping tic for...

15 years ago | 0

Answered
I need help.
Thank you for formatting it. Do you use the MATLAB editor? It displays syntax errors on the right margin as red lines. You can ...

15 years ago | 1

| accepted

Answered
Why is it used?
As written, your code cannot possibly run because of some of the spaces. I will substitute underlines: I=find(and(dR > min...

15 years ago | 0

Answered
resolution of PDE
Here is one error: in this line, pl = [C1(1);q0-Cl(2)]; the first |C1| is |C| followed by the numeral |1|, but it should...

15 years ago | 0

Answered
Using MATLAB with Chessboard arrangements problem
If the positions don't need to be legal, you can use combinatorial calculations. For example, let's first suppose that you can't...

15 years ago | 1

Answered
Load a Text File in a GUI
Based on your description of the file, this code might be able to read the file: fid = fopen('testInput.txt'); data2 =...

15 years ago | 0

| accepted

Answered
Incorrect equilibrium values using fsolve
The answer provided by |fsolve| looks better than yours: >> odefun_dynamic_droop([2.6605e-07 3.6300e-06 2.5009e-06]) a...

15 years ago | 0

Answered
Find the Error - FZero Function. Constant loop.
The root of the problem is that you're trying to solve for |NCons = NFirm| by minimizing each of these functions at each step. T...

15 years ago | 0

| accepted

Load more