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

casi 14 años hace | 1

| aceptada

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

casi 14 años hace | 0

| aceptada

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

casi 14 años hace | 2

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

casi 14 años hace | 2

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

casi 14 años hace | 3

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

casi 14 años hace | 0

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

casi 14 años hace | 0

| aceptada

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

casi 14 años hace | 0

| aceptada

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

casi 14 años hace | 0

| aceptada

Respondida
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

casi 14 años hace | 2

| aceptada

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

casi 14 años hace | 0

| aceptada

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

casi 14 años hace | 0

| aceptada

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

casi 14 años hace | 0

| aceptada

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

casi 14 años hace | 0

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

casi 14 años hace | 0

| aceptada

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

casi 14 años hace | 0

| aceptada

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

casi 14 años hace | 2

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

casi 14 años hace | 1

| aceptada

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

casi 14 años hace | 1

| aceptada

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

casi 14 años hace | 1

| aceptada

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

casi 14 años hace | 0

| aceptada

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

casi 14 años hace | 0

| aceptada

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

casi 14 años hace | 0

| aceptada

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

casi 14 años hace | 0

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

casi 14 años hace | 0

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

casi 14 años hace | 0

| aceptada

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

casi 14 años hace | 0

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

casi 14 años hace | 1

| aceptada

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

casi 14 años hace | 0

| aceptada

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

casi 14 años hace | 0

| aceptada

Cargar más