Answered
hold all vs. hold on
You can find the colors used for hold all by issuing the command get(gca,'ColorOrder') which returns: 0 0 ...

mer än 12 år ago | 1

Answered
Constructing a block diagonal matrix using the contents of a cell
I'm not quite sure of your end goal, the syntax "A(AA{1},AA{1}) in the entry (1,1)" isn't clear to me. But, you may find the ...

mer än 12 år ago | 1

Answered
Concatenate
z = {'hello1','hello2','hello3'}; y = {'bye1','bye2','bye3'}; x = reshape(1:9,3,3); v = [ z ; y ; num2cell(x) ]

mer än 12 år ago | 0

Answered
Grid
I may be oversimplifying it, but perhaps issue a hold off at the end of the code and see if this gives you behavior you...

mer än 12 år ago | 0

| accepted

Answered
Simple Data Analysis
1) Array-wise division ./ Without it, you are solving the equation A*x = b for A with "matrix division" (A = b/x) so that if...

mer än 12 år ago | 1

| accepted

Answered
which are the different markers?
<http://www.mathworks.com/help/releases/R2011b/techdoc/ref/linespec.html linespec> shows the available marker styles.

mer än 12 år ago | 0

Answered
sorting 3d matrix by value of a cell
From what I understand, you just want to sort by an element on each page in the 3D array - this is how you can do it: A = r...

mer än 12 år ago | 1

| accepted

Answered
use of for and if
If all values are scalars and t is the only vector, you can just leave the equations as they are and MATLAB will create output v...

mer än 12 år ago | 0

Answered
How to load a file
The following code snippet will load your data into the matrix data: fid = fopen('TestFile.txt'); M = textscan(fid,'(%f,...

mer än 12 år ago | 0

| accepted

Answered
Help about foor loops.
You can do this without using a FOR loop - keep it vectorized. I think that the following code achieves the results you're seek...

mer än 12 år ago | 0

| accepted

Answered
File .txt in MatLab
The following code will create a cell array that does what you like. Since you have mixed data types in the file, a cell array ...

mer än 12 år ago | 1

Answered
reference a structure array
You can use the fieldnames function and then use parentheses around the fieldname when called with a variable, see the code belo...

mer än 12 år ago | 2

| accepted

Answered
graphing colors
You need to have the letter for the color in single quotes. Or, you can specify using <http://www.mathworks.com/help/releases/R...

mer än 12 år ago | 0

Answered
Extract top 10 values from each row
This code will keep the top ten rows and replaces everything from the 11th row on with a zero. A = rand(100); A(11:end,:) =...

mer än 12 år ago | 1

Answered
how to make all vectors to equal size for a cell array.
lv = max(cellfun(@length,z)); za = zeros(1,lv); for idx = 1:length(z) cellVal = z{idx}; if length(cellVal) <...

mer än 12 år ago | 1

Answered
ERROR with type off data
Because you are creating the variable iter from the variable itmax, it will also be uint8, so you will need to cast it as a sing...

mer än 12 år ago | 0

Answered
sprintf bug?
It has to do with the size of the value you are entering; it is larger than the largest integer-valued floating-point number (2^...

mer än 12 år ago | 1

| accepted

Answered
how to append data to existing excel row
Is it just a matter of subtracting one from the length to keep writing on the same row? posi = ['C',num2str(length(xraw(:,3...

mer än 12 år ago | 0

Answered
[globalsearch] nonlinear constraint violation
Are you receiving a message that the optimal solution has been found? What is the final message saying?

mer än 12 år ago | 0

Answered
[globalsearch] nonlinear constraint violation
The next thing I would check is to be sure that the nonlinear inequality constraint function is evaluated such that it should be...

mer än 12 år ago | 0

Answered
Squeeze fx for cell arrays?
temp_data = [ tempdata{:} ]; temp_data = reshape(temp_data,4,3)';

mer än 12 år ago | 3

| accepted

Answered
[globalsearch] nonlinear constraint violation
How are you defining the nonlinear constraint function? If you only have an equality nonlinear constraint, you still need the...

mer än 12 år ago | 0

Answered
Getting error of Double
Try the command which dtmfdial at the command window. Perhaps the function is not on your path or you have a variable ...

mer än 12 år ago | 0

Answered
How to convert a string to int
The command save n will save all the variables in your function workspace to a file named n.mat. Is this what you inte...

mer än 12 år ago | 2

| accepted

Answered
How to manage a list of variables with parameters?
You may want to check out <http://www.mathworks.com/help/releases/R2011b/techdoc/ref/struct.html structures> or <http://www.math...

mer än 12 år ago | 1

Answered
How to generate data with a specific distribution
Use the <http://www.mathworks.com/help/releases/R2011a/toolbox/stats/random.html random> function. Here's an example of creatin...

nästan 13 år ago | 2

Answered
how to join points on MATLAB plot
I've gone through and vectorized your code (taken out the for loops); this will help it to run faster. The plot command now joi...

nästan 13 år ago | 1

| accepted

Answered
how to read my variables ?
Start with this <http://www.mathworks.com/videos/matlab/getting-started-with-matlab.html Getting Started with MATLAB> video. ...

nästan 13 år ago | 0

Answered
time increment and julian date
Create the initial date as a 1x6 vector: od = [ 2011 08 18 0 0 0 ]; Then, to add 30 minutes at each iteration, add 30 to...

nästan 13 år ago | 1

| accepted

Answered
Help me understand this warning message
You have an algebraic loop in your diagram which will slow-down your computation time and may not converge to a solution. You c...

nästan 13 år ago | 0

Load more