Risposto
Why won't a function handle plot?
When you make a function, you should use it like a function... syms x A = 3*x + 5*x^3; B = matlabFunction(A); x = ...

quasi 14 anni fa | 1

| accettato

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

quasi 14 anni fa | 0

| accettato

Risposto
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('...

quasi 14 anni fa | 2

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

quasi 14 anni fa | 2

Risposto
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'],...

quasi 14 anni fa | 3

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

quasi 14 anni fa | 0

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

quasi 14 anni fa | 0

| accettato

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

quasi 14 anni fa | 0

| accettato

Risposto
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; ...

quasi 14 anni fa | 0

| accettato

Risposto
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

quasi 14 anni fa | 2

| accettato

Risposto
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{...

quasi 14 anni fa | 0

| accettato

Risposto
Run .m script from GUI
You don't need to type run. Just the name of the script will cause the script to execute.

quasi 14 anni fa | 0

| accettato

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

quasi 14 anni fa | 0

| accettato

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

quasi 14 anni fa | 0

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

quasi 14 anni fa | 0

| accettato

Risposto
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); ...

quasi 14 anni fa | 0

| accettato

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

quasi 14 anni fa | 2

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

quasi 14 anni fa | 1

| accettato

Risposto
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." ...

quasi 14 anni fa | 1

| accettato

Risposto
Remove every second tick on y-axis
set(gca,'ytick',0:.2:1)

quasi 14 anni fa | 1

| accettato

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

quasi 14 anni fa | 0

| accettato

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

quasi 14 anni fa | 0

| accettato

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

quasi 14 anni fa | 0

| accettato

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

quasi 14 anni fa | 0

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

quasi 14 anni fa | 0

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

quasi 14 anni fa | 0

| accettato

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

quasi 14 anni fa | 0

Risposto
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(...

quasi 14 anni fa | 1

| accettato

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

quasi 14 anni fa | 0

| accettato

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

quasi 14 anni fa | 0

| accettato

Carica altro