Réponse apportée
Setting X as a column of a matrix
Use a FOR loop to loop over the rows of column 2. But you are going to want to *define* A,B,C,D,F or you will get errors. Unle...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
Question about 'save' option for workspace variable saving
It always helps to read the help. If you do, you will see something like this: save(filename,variable) So, save('...

plus de 13 ans il y a | 2

Réponse apportée
Some basic MATLAB questions
Another one-liner (short!): % x is the unknown numerical grade. G = char(65+sum(x<.5+[59 59:10:89])); As it stands it...

plus de 13 ans il y a | 2

Réponse apportée
Some basic MATLAB questions
As per requested: % x is the numerical unknown grade G = char(interp1([-inf,59,60,69,70,79,80,89,90,inf],['FFDDCCBBAA'],...

plus de 13 ans il y a | 3

Réponse apportée
Passing two subfunction variables in GUI to another function
You add to handles, but then do not save handles. See the help for GUIDATA.

plus de 13 ans il y a | 0

Réponse apportée
Some basic MATLAB questions
X = round(rand*6) if X<3 disp('Small X') elseif X==3 disp('X is 3') elseif X>=3 & X<5 disp('Me...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
Axes WIndows in Guide Disappearing
What do you mean by 'switching between' the axes? Just to be clear, in MATLAB a window is called a figure. So do you mean you ...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
choosing from numbers whose sum is X
I suppose you mean integers, but you don't say.... N = round(randn(1,1000)); S = 0; maxiter = 2e6; cnt = 1; ...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
Error: Unable to locate 'mexopts.bat'
I would suggest you follow the advice of the error message! Type this at the command line: mex -setup

plus de 13 ans il y a | 2

| A accepté

Réponse apportée
combining information of 2 cells
ref = {{'m3m1f1';'y9h5g5';'u8h1h5'}; {50.00;50.44;30.98}}; A = {'y9h5g5';'m3m1f1'}; [J,J] = ismember(A,ref{1}); % Or A{...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
Run .m script from GUI
You don't need to type run. Just the name of the script will cause the script to execute.

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
Help with while loop
You were pretty close, but there are a couple of mistakes. # You start out the error at zero, then ask the loop to run onl...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
How can I label the same line using different color
One way to get the effect is to use two lines. a = 0:0.01:2*pi; b = sin(a); b2 = b; b(b<=0) = nan; % nan values ...

plus de 13 ans il y a | 0

Réponse apportée
not urgent, but if you see this and have time please help me, thank you , Please help , LAST prime under n
O.k., you gave it a good shot, but there are some simple mistakes here. You want to use the ISPRIME function, but you define a ...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
Generating index from end and start index
If you don't want to use a mex file, this is very fast: % Make your index into A L = length(s); F = cumsum(e-s+1); ...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
[DISCONTINUED] MATLAB Answers Wish-list #2 (and bug reports)
I wish the answers software would automatically delete the tag: MATLAB.

plus de 13 ans il y a | 2

Réponse apportée
Split a matrix into smaller pieces - help
A = reshape(1:36*16,16,36); B = mat2cell(A,[4 4 4 4],36); Now you have each submatrix stored in a cell of B. For exampl...

plus de 13 ans il y a | 1

| A accepté

Réponse apportée
How to display non-zero part of a curve
I assume when you say that you want to "display the non-zero values" you mean you want to "plot only the non-zero values." ...

plus de 13 ans il y a | 1

| A accepté

Réponse apportée
Remove every second tick on y-axis
set(gca,'ytick',0:.2:1)

plus de 13 ans il y a | 1

| A accepté

Réponse apportée
[HELP] A Classical Numerical Computing Question
No, they shouldn't be the same at the fringes. This is an example of why we often have to look for more stable ways of doing in...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
Problems with Conditionally execute statements
<http://blogs.mathworks.com/loren/2012/06/15/whats-if-all-about/ If statements do not pick out elements of arrays>! for ...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
How do I use the who command within a function
When a function is running, the current workspace is the workspace of the function. That is just how it works. Why not jus...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
how to increase the height of sublpot?
Did you try two rows and four columns? This might be better if your monitor is wider than tall, like mine. Other than that, ju...

plus de 13 ans il y a | 0

Réponse apportée
why does transposing a sparse matrix change its memory requirements
Yes, MATLAB uses compressed column storage, not compressed row storage. Notice: >> x = sparse(zeros(1,10000)); >> who...

plus de 13 ans il y a | 0

Réponse apportée
How to make script to function for sprintf command
There are several problems. For one, you don't specify any return argument for your function. Try this one: function na...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
How can to convert this following cell to single matrix
O.k., here is an example. First I will build a cell array as you show, then I will get it to matrix B. % First build you...

plus de 13 ans il y a | 0

Réponse apportée
Passing Parameters from GUI to Script
If _setup_ is a script, you are actually running it from in the callback. If that is o.k., try this: function Go_Callback(...

plus de 13 ans il y a | 1

| A accepté

Réponse apportée
How to obtain the row and column indices of a "bsxfun" matrix
Use <http://www.mathworks.com/help/matlab/ref/ind2sub.html IND2SUB> or <http://www.mathworks.com/help/matlab/ref/find.html FIND>...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
For loops and taylor series
Use this loop instead: for k = 0:n approxValue = (approxValue + x.^k/factorial(k)); % Gives the approx valu...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
How to create variables in the command prompt space using a function
First of all, comments in MATLAB are given by %, not //. Second, which function are you calling first, and from where, and wh...

plus de 13 ans il y a | 0

| A accepté

Charger plus