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

oltre 15 anni fa | 1

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

oltre 15 anni fa | 2

| accettato

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

oltre 15 anni fa | 1

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

oltre 15 anni fa | 0

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

oltre 15 anni fa | 0

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

oltre 15 anni fa | 0

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

oltre 15 anni fa | 2

| accettato

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

oltre 15 anni fa | 0

| accettato

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

oltre 15 anni fa | 2

| accettato

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

oltre 15 anni fa | 3

| accettato

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

oltre 15 anni fa | 0

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

oltre 15 anni fa | 1

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

oltre 15 anni fa | 1

| accettato

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

oltre 15 anni fa | 1

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

oltre 15 anni fa | 1

| accettato

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

oltre 15 anni fa | 1

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

oltre 15 anni fa | 2

| accettato

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

oltre 15 anni fa | 3

| accettato

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

oltre 15 anni fa | 2

| accettato

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

oltre 15 anni fa | 3

| accettato

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

oltre 15 anni fa | 0

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

oltre 15 anni fa | 0

| accettato

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

oltre 15 anni fa | 4

| accettato

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

oltre 15 anni fa | 0

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

oltre 15 anni fa | 0

| accettato

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

oltre 15 anni fa | 1

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

oltre 15 anni fa | 1

| accettato

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

oltre 15 anni fa | 3

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

oltre 15 anni fa | 0

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

oltre 15 anni fa | 0

Carica altro