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

más 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...

más 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...

más 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: ...

más 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...

más 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...

más 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...

más 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...

más 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...

más 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...

más 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?

más 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...

más 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> ...

más 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...

más 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 ...

más 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')

más 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'); ...

más 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...

más 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...

más 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...

más 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) ...

más 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-...

más 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...

más 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(...

más 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...

más 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...

más 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...

más 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...

más 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...

más 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 ...

más de 15 años hace | 1

Cargar más