已回答
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 ...

13 years 前 | 1

已回答
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 ...

13 years 前 | 1

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

13 years 前 | 0

已回答
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...

13 years 前 | 0

| 已接受

已回答
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...

13 years 前 | 1

| 已接受

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

13 years 前 | 0

已回答
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...

13 years 前 | 1

| 已接受

已回答
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...

13 years 前 | 0

已回答
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,...

13 years 前 | 0

| 已接受

已回答
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...

13 years 前 | 0

| 已接受

已回答
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 ...

13 years 前 | 1

已回答
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...

13 years 前 | 2

| 已接受

已回答
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...

13 years 前 | 0

已回答
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,:) =...

13 years 前 | 1

已回答
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) <...

13 years 前 | 1

已回答
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...

13 years 前 | 0

已回答
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^...

13 years 前 | 1

| 已接受

已回答
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...

13 years 前 | 0

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

13 years 前 | 0

已回答
[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...

13 years 前 | 0

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

13 years 前 | 3

| 已接受

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

13 years 前 | 0

已回答
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 ...

13 years 前 | 0

已回答
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...

13 years 前 | 2

| 已接受

已回答
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...

13 years 前 | 1

已回答
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...

13 years 前 | 2

已回答
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...

13 years 前 | 1

| 已接受

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

13 years 前 | 0

已回答
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...

13 years 前 | 1

| 已接受

已回答
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...

13 years 前 | 0

加载更多