Respondida
vector to repeated matrix multiplication
Not being able to think up a more elegant solution off the top of my head, how about reshape(repmat(A(:),1,3)*(V'),2,2) Or, ...

alrededor de 15 años hace | 1

Respondida
Integration using function calls
Your question doesn't really make sense, because the integral/quadrature approximation, for a given N, is a single number. From...

alrededor de 15 años hace | 1

Respondida
Conditional plotting, changing color of line based on value.
Because I'm a dork, I made a function to do this. It's now available on <http://www.mathworks.com/matlabcentral/fileexchange/30...

alrededor de 15 años hace | 1

Respondida
Having Trouble Plotting 4D data
Here's another possibility for looking at the sparsity of the data. You said many of the values were 0, so maybe try this: ...

alrededor de 15 años hace | 0

Respondida
Adding z-values for surf/contour plots
Is this what you're after? I'm not sure if you mean "add" the z-values literally (z1 + z2) or "add" in the sense of append to t...

alrededor de 15 años hace | 1

| aceptada

Respondida
nlinfit Options - how to set them?
doc statset |statset| is a function that will create a structure variable of options; you then pass this structure into |nl...

alrededor de 15 años hace | 1

| aceptada

Respondida
[DEPRECATED] What frustrates you about MATLAB?
The way that anything that turns char into cell arrays strips spaces when it does so. Sometimes -- often, in fact -- I want tho...

alrededor de 15 años hace | 1

Respondida
nonlinear regression
If you have Statistics Toolbox, you can use |nlinfit|, although there's no guarantee that k will be in the interval (0,1). Make...

alrededor de 15 años hace | 0

| aceptada

Respondida
time shifting
On top of the syntax issues Walter and Jan point out... 1. Why use |switch|? You could easily use a simple |if|/|else|. But...

alrededor de 15 años hace | 0

Respondida
Max. distance in a bidimensionnal vector
If Bruno's solution is what you want, and you have Statistics Toolbox, you can use |pdist| to calculate all the pairwise distanc...

alrededor de 15 años hace | 0

Respondida
xls export problem
Dare I ask... When you say you set |xls_1 = 857_386.xls|, you do mean |xls_1 = '857_386.xls'|, right?

alrededor de 15 años hace | 0

Respondida
t
This appears to be a reply to an earlier question's discussion. Can you please transfer it to the appropriate place, and delete...

alrededor de 15 años hace | 0

Respondida
How to save the data set from the ode function files to the workspace
You should be able to use |save('filename')| within the function: <http://www.mathworks.com/help/matlab/ref/save.html save doc> ...

alrededor de 15 años hace | 0

Respondida
How do I plot this non-linear function...
You should be getting an error on the line that defines |r2| (before you even get to the plot). As Matt Fig points out, the mul...

alrededor de 15 años hace | 0

Respondida
Using a function with input parameters in ode45
The problem here seems to be that you're mixing up your representation of your dependent variables. The rate equation function ...

alrededor de 15 años hace | 0

| aceptada

Respondida
Plotting a function...
[x,y] = meshgrid(0:0.5:40); gam = atand(y./x); surf(x,y,gam,'linestyle','none')

alrededor de 15 años hace | 0

Respondida
dat file
I'm going to assume that you're talking about a text data file. In that case, use |textscan|: fid = fopen('filename.dat'); ...

alrededor de 15 años hace | 0

Respondida
matrix issue with null
If you want a 2-by-|Maxstep| table of nulls, you can do T = NaN(2,Maxstep); This way, |T| will be numeric. Otherwise, g...

alrededor de 15 años hace | 0

| aceptada

Respondida
Plotting a year by hour
If you're starting just with data and the knowledge that it was recorded hourly throughout a given year, why not just do somethi...

alrededor de 15 años hace | 0

Respondida
matrix issue with null
Best practice is to make separate posts for separate questions. For the first question, can you explain what the desired output...

alrededor de 15 años hace | 0

Respondida
Plotting a year by hour
So the issue is how to extract the first 8760 elements of a vector of 8761 points? That's easy enough: plot(x(1:end-1),y) ...

alrededor de 15 años hace | 0

Respondida
Wrong with matrix dimensions
Aside: you can replace acc(1) = j(1); for h = 2:length(j) %lägger ihop pulserna från geigermätaren acc(h)= acc(h-...

alrededor de 15 años hace | 0

Respondida
Wrong with matrix dimensions
I assume the error is at the bolded line ( |e = PH./p| ). It looks like this is due to a row vs column issue (as Walter mention...

alrededor de 15 años hace | 0

| aceptada

Respondida
How do I group boxplots by modifying the X locations?
You can cluster groups together using the 'factorgap' option. Would that do what you want? % make some fake data x = rand(...

alrededor de 15 años hace | 1

Respondida
Is there a more efficient way to read a .txt data file into MATLAB?
BTW, Jonathan, a good practice is to ask a separate new question, because this second question might be something someone else m...

alrededor de 15 años hace | 1

Respondida
Bullets in MATLAB GUIs
It's not great (see Walter's answer for more discussion), but this basically works: x = {'abc';'defg';'hijkl';'mn'}; y = re...

alrededor de 15 años hace | 1

| aceptada

Respondida
Is there a more efficient way to read a .txt data file into MATLAB?
If the file is tab-delimited, this will do it: fid = fopen('filename.txt'); headers = textscan(fid,'%s%s%s%s%s',1,'delimite...

alrededor de 15 años hace | 1

| aceptada

Respondida
fsolve help
OK, the formatting is a bit hideous, but I think I see the problem: you're trying to reference the loop index |i| inside the fun...

alrededor de 15 años hace | 0

Respondida
Error - ??? Improper assignment with rectangular empty matrix - using "for"
You can also use MATLAB set functions, under certain assumptions. In particular, if you expect both A & B to have exactly the s...

alrededor de 15 años hace | 0

| aceptada

Respondida
Command for triangle
MATLAB Answers is a place you can get help from the user community on specific MATLAB questions. It is not intended as a place ...

alrededor de 15 años hace | 1

Cargar más