Réponse apportée
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 ...

environ 14 ans il y a | 1

Réponse apportée
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 ...

environ 14 ans il y a | 1

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

environ 14 ans il y a | 0

Réponse apportée
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...

environ 14 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 14 ans il y a | 1

| A accepté

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

environ 14 ans il y a | 0

Réponse apportée
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...

environ 14 ans il y a | 1

| A accepté

Réponse apportée
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...

environ 14 ans il y a | 0

Réponse apportée
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,...

plus de 14 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 14 ans il y a | 0

| A accepté

Réponse apportée
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 ...

plus de 14 ans il y a | 1

Réponse apportée
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...

plus de 14 ans il y a | 2

| A accepté

Réponse apportée
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...

plus de 14 ans il y a | 0

Réponse apportée
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,:) =...

plus de 14 ans il y a | 1

Réponse apportée
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) <...

plus de 14 ans il y a | 1

Réponse apportée
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...

plus de 14 ans il y a | 0

Réponse apportée
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^...

plus de 14 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 14 ans il y a | 0

Réponse apportée
[globalsearch] nonlinear constraint violation
Are you receiving a message that the optimal solution has been found? What is the final message saying?

plus de 14 ans il y a | 0

Réponse apportée
[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...

plus de 14 ans il y a | 0

Réponse apportée
Squeeze fx for cell arrays?
temp_data = [ tempdata{:} ]; temp_data = reshape(temp_data,4,3)';

plus de 14 ans il y a | 3

| A accepté

Réponse apportée
[globalsearch] nonlinear constraint violation
How are you defining the nonlinear constraint function? If you only have an equality nonlinear constraint, you still need the...

plus de 14 ans il y a | 0

Réponse apportée
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 ...

plus de 14 ans il y a | 0

Réponse apportée
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...

plus de 14 ans il y a | 2

| A accepté

Réponse apportée
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...

plus de 14 ans il y a | 1

Réponse apportée
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...

plus de 14 ans il y a | 2

Réponse apportée
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...

plus de 14 ans il y a | 1

| A accepté

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

plus de 14 ans il y a | 0

Réponse apportée
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...

plus de 14 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 14 ans il y a | 0

Charger plus