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

casi 13 años hace | 1

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

casi 13 años hace | 1

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

casi 13 años hace | 0

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

casi 13 años hace | 0

| aceptada

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

alrededor de 13 años hace | 1

| aceptada

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

alrededor de 13 años hace | 0

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

alrededor de 13 años hace | 1

| aceptada

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

alrededor de 13 años hace | 0

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

alrededor de 13 años hace | 0

| aceptada

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

alrededor de 13 años hace | 0

| aceptada

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

alrededor de 13 años hace | 1

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

alrededor de 13 años hace | 2

| aceptada

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

alrededor de 13 años hace | 0

Respondida
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,:) =...

alrededor de 13 años hace | 1

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

alrededor de 13 años hace | 1

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

alrededor de 13 años hace | 0

Respondida
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^...

alrededor de 13 años hace | 1

| aceptada

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

alrededor de 13 años hace | 0

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

alrededor de 13 años hace | 0

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

alrededor de 13 años hace | 0

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

alrededor de 13 años hace | 3

| aceptada

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

alrededor de 13 años hace | 0

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

alrededor de 13 años hace | 0

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

alrededor de 13 años hace | 2

| aceptada

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

alrededor de 13 años hace | 1

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

más de 13 años hace | 2

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

más de 13 años hace | 1

| aceptada

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

más de 13 años hace | 0

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

más de 13 años hace | 1

| aceptada

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

más de 13 años hace | 0

Cargar más