已回答
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 = ...

14 years 前 | 1

| 已接受

已回答
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...

14 years 前 | 0

| 已接受

已回答
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('...

14 years 前 | 2

已回答
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...

14 years 前 | 2

已回答
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'],...

14 years 前 | 3

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

14 years 前 | 0

已回答
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...

14 years 前 | 0

| 已接受

已回答
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 ...

14 years 前 | 0

| 已接受

已回答
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; ...

14 years 前 | 0

| 已接受

已回答
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

14 years 前 | 2

| 已接受

已回答
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{...

14 years 前 | 0

| 已接受

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

14 years 前 | 0

| 已接受

已回答
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...

14 years 前 | 0

| 已接受

已回答
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 ...

14 years 前 | 0

已回答
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 ...

14 years 前 | 0

| 已接受

已回答
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); ...

14 years 前 | 0

| 已接受

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

14 years 前 | 2

已回答
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...

14 years 前 | 1

| 已接受

已回答
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." ...

14 years 前 | 1

| 已接受

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

14 years 前 | 1

| 已接受

已回答
[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...

14 years 前 | 0

| 已接受

已回答
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 ...

14 years 前 | 0

| 已接受

已回答
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...

14 years 前 | 0

| 已接受

已回答
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...

14 years 前 | 0

已回答
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...

14 years 前 | 0

已回答
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...

14 years 前 | 0

| 已接受

已回答
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...

14 years 前 | 0

已回答
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(...

14 years 前 | 1

| 已接受

已回答
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>...

14 years 前 | 0

| 已接受

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

14 years 前 | 0

| 已接受

加载更多