Community Profile

Contact

Top 5% contributor

The subscripted assignment dimension error is caused when you try to assign a vector of length 1651x1 to a 1x1 subarray of z_dot...

accepted

1

Answered 7 months ago

I don't have MATLAB in front if me to test it, but you could try adding a single quote before the string, as in xlswrite(...

Answered 8 months ago

7 downloads

1 year ago

Like Cedric, I keep thinking of iterating over interval length. Another way to look at the vector |b| is as the sum of the outpu...

3

Answered 2 years ago

The documentation for |struc| indicates that it takes three input arguments: >>help struc struc Generate typical struc...

You cannot use indexing in the arguments listed in the function definition. Try instead: function [u,w] = velocity(H,sigma,k...

I have created a minimal example (available here: <http://dl.dropbox.com/u/99981625/fraction_in_condition.mdl>) consisting of a ...

1 Answers

Asked 2 years ago

Jan Simon's solution is interesting because cumsum can be though of as an IIR filter, and so this idea can further improve the F...

2

The code you have posted may work just fine in MATLAB, but will not work in Simulink. Not all functions are supported for use in...

0

The syntax for |fmincon| is WW = fmincon(F,x0,A,b,Aeq,beq,lb,ub) In your code, the initial guess |x0| is a 6x3 matrix, ...

So |F|, |lambda|, and |torque| are the variables, correct? Define |x = [F; lambda; torque]|. Then you can rearrange cons...

This is a linear regression problem, since it is linear in the coefficients. Assuming |E|, |H|, and |T| are column vectors, you ...

You could make |S| a cell array in the loop, then create a matrix afterward: somefunction = @(x)deal(x,rand(1)<0.3); S=c...

Answered 9 months ago

You can avoid saving all of the intermediate intervals (e.g., [1 2 3 4]) if you just want the count: a = [1 4;3 5;4 7;6 8]; ...

Presumably you want array division instead of a LS solution. Try s=A+((B*exp(-1.001*((x.^2) + 100)))./((x.^2) +100)) % ...

Indices start at 1, so j=0; ... while (1.00<r(j) r(j)<0.99) is referencing a value that does not exist (the 0th val...

1. The OutputFcn should have the format status = myfun(t,y,flag) but your anonymous function takes a single input (status...

Do you want array division when you write (u0*I*y)/(2*pi*rplus) and similar expressions? If so, then you need to use ...

You cannot use the same name for a function and for its output argument. Try function [val]=f(x) val=((x^5...

Then, when you want to build the complete |LOCATION| matrix, you can do something like LOCATION2 = zeros(15, 4); LOCATION2...

|fsolve| will only pass in a single argument, so |i| will be undefined. Assuming you want to solve this equation for fixed value...

If you only want to pause when specific conditions are satisfied, you can put the |pause| or |keyboard| statement inside an if c...

I know nothing about mimicking portfolios, but I do know that anything you assign to |thetaa| is lost when you call syms the...

You can pass an options structure to |fmincon|. You create the structure using <http://www.mathworks.com/help/matlab/ref/optimse...

y = (x>2).*(x+1) + (x<=2).*(x-1)

Try echo off

Use unique([1 2 2 2 3 4 5]) Note that this will also sort the elements. -B

This seems to be what you are looking for: onset=[23 40 67 88] duration=[3 9 2 6] all=cell2mat(arrayfun(@(a,b)a+(1:b)-1,...

|e = eig(A)| returns a vector of eigenvalues of the matrix |A|. To get the associated eigenvectors, use |[V,D] = eig(A)|. See th...

Did you save the results of rmfield back to myStruct? myStruct = rmfield(myStruct, myField) Brian

Load more