Answered
How to create a 3-D ternary plot
I don't know of any built-in way to do exactly this in basic MATLAB. It could be done as a custom function, but I don't think i...

15 years ago | 1

Answered
Using slider in GUIDE to perform 2 tasks
For task 2, do exactly the same thing you did with task 1, except add 1. You might be having trouble with adding 1 because you ...

15 years ago | 2

| accepted

Answered
Opening a file that requires another file for input
Get the string in the listbox, and pass it to the function which needs it. In the callback for the pushbutton, you put somethin...

15 years ago | 1

Answered
k=1;201;
It means: set the variable k to equal 1, then set the variable ans to 201, displaying nothing. You can see this by executing ...

15 years ago | 0

Answered
rotation about a point
Perhaps an example would work. You can use the function ROTATE to do what you want. I have shown an example, with minimal comm...

15 years ago | 0

Answered
Fzero returns non-zero value
Include all the details, meaning: the function DPHIDLAMBDA, and the parameters used to call FZERO (q0,langd, Amax, etc). I...

15 years ago | 0

Answered
data manipulation
I think this file does exactly what you are looking to do: <http://www.mathworks.com/matlabcentral/fileexchange/24536-expand>...

15 years ago | 2

| accepted

Answered
how to store eigen vectors of a matrix of huge dimension?
If X is your 500-by-500 array, then using: [V,D] = eig(X) will store the eigenvalues in array V.

15 years ago | 0

| accepted

Answered
FETCH LARGEST NUMBERS
1. Take the capslock off. 2. Sort your array in descending order. Use the SORT function. 3. Take the first 3 numbers in th...

15 years ago | 2

| accepted

Answered
"roots" function not working
You have a variable named roots. Do this : clear roots p = [1 -6 -72 -27]; r = roots(p); Don't name variables after bu...

15 years ago | 3

| accepted

Answered
word scrambler script
I suspect the problem comes from your (seeming) assumption that the code inside the IF statement only operates on those elements...

15 years ago | 0

Answered
How to specific random numbers rang?
As Walter stated, this is not really possible exactly. However, you can get close (to some level of tolerance): x = ceil(4...

15 years ago | 1

Answered
If statements with matricies
You might want the two output version of FIND. The one output version does not return the row number, but the linear index. ...

15 years ago | 1

| accepted

Answered
Error correction...inner matrix dimensions must be same??? how to correct ?
You must put a dot before any *, / or ^ used when you want element-by-element operations on arrays of the same size. Note that ...

15 years ago | 1

Answered
Solve a cubic equation using MATLAB code
From your comments, it looks like you want this instead: function [] = solve_cubic() w=10:2:30; a=4*((9*w)-7); ...

15 years ago | 1

| accepted

Answered
Multiply then sum elements of two matrices
Another (this should be faster than calling SUM): reshape(A,1,[])*reshape(B,[],1)

15 years ago | 1

Answered
sprintf problems
I assume you are using the string in a loop. If not, adjust accordingly. for ii = 1:5 S = sprintf('\\\\psf\\Home\\Documen...

15 years ago | 2

| accepted

Answered
Produce matrix with loop
_Most people_ on here will *_not_* just do a whole homework assignment for you. If you don't do any work, you will not learn. ...

15 years ago | 3

| accepted

Answered
Get index of specific string in popup
L = strmatch('polynomial',get(ls,'string')); set(ls,'value',L)

15 years ago | 2

| accepted

Answered
how can I create a matrix from calculated answers
Don't you think it would help if you showed us how that "this answers" was generated? It really would. . . . . . . *EDIT...

15 years ago | 3

| accepted

Answered
Representing a number as a matrix
One approach: N = arrayfun(@str2num,sprintf('%i',146)) or (along the lines of James' answer) N = sprintf('%i',146)-'0'...

15 years ago | 0

Answered
How to solve linear differential equation
Look at the help for <http://www.mathworks.com/help/techdoc/ref/ode23.html ODE45>.

15 years ago | 0

| accepted

Answered
Sum of many inputs
function S = sumthemall(varargin) % Takes as many scalars as you want, returns the sum. S = sum([varargin{:}]); . . . ...

15 years ago | 4

| accepted

Answered
gui callback stop problem...
Are you talking about this FOR loop: for j=0:1:400 end guidata(hObject, handles); There is nothing in the body of that ...

15 years ago | 0

Answered
Displaying files using a Listbox
Is the folder of files you wish to display going to be hardcoded into the GUI, or do you wish to have the user select the folder...

15 years ago | 0

| accepted

Answered
How do I generate a given Matrix in one command?
One line, anyway. And since the array is at least dynamically pre-allocated, the code is fast. for ii = 5:-1:1,for jj = min(...

15 years ago | 1

Answered
how to continue program with fzero error
Use a TRY-CATCH block. I'll assume you are looping over the parameter set and storing the roots in a variable S. cnt = 1; ...

15 years ago | 1

| accepted

Answered
How long have you been using matlab? tell us your story
I first saw MATLAB in 1997 (v4.?) when taking a linear algebra class to satisfy my Math major. The class used <http://www.powel...

15 years ago | 3

Answered
GUI Output
What code are you using to display the sentence?

15 years ago | 0

Answered
Search nx3 array row-wise for 2 equal elements
Another approach which may get you some speed if your real X array is larger than the one you show. Xs = sort(X,2); S = ...

15 years ago | 0

Load more