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

mehr als 15 Jahre vor | 1

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

mehr als 15 Jahre vor | 1

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

mehr als 15 Jahre vor | 1

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

mehr als 15 Jahre vor | 0

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

mehr als 15 Jahre vor | 1

| akzeptiert

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

mehr als 15 Jahre vor | 1

| akzeptiert

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

mehr als 15 Jahre vor | 1

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

mehr als 15 Jahre vor | 0

| akzeptiert

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

mehr als 15 Jahre vor | 0

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

mehr als 15 Jahre vor | 0

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

mehr als 15 Jahre vor | 0

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

mehr als 15 Jahre vor | 0

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

mehr als 15 Jahre vor | 0

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

mehr als 15 Jahre vor | 0

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

mehr als 15 Jahre vor | 0

| akzeptiert

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

mehr als 15 Jahre vor | 0

Beantwortet
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'); ...

mehr als 15 Jahre vor | 0

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

mehr als 15 Jahre vor | 0

| akzeptiert

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

mehr als 15 Jahre vor | 0

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

mehr als 15 Jahre vor | 0

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

mehr als 15 Jahre vor | 0

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

mehr als 15 Jahre vor | 0

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

mehr als 15 Jahre vor | 0

| akzeptiert

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

mehr als 15 Jahre vor | 1

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

mehr als 15 Jahre vor | 1

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

mehr als 15 Jahre vor | 1

| akzeptiert

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

mehr als 15 Jahre vor | 1

| akzeptiert

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

mehr als 15 Jahre vor | 0

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

mehr als 15 Jahre vor | 0

| akzeptiert

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

mehr als 15 Jahre vor | 1

Mehr laden