Réponse apportée
How to export data from a GUI to Matlab Workspace?
In the code of the GUI, when you want to export the variables do: save guioutput This will save all of the variables in ...

plus de 13 ans il y a | 0

Réponse apportée
Best way to determine if number is triangular number?
istri = @(x) floor(sqrt(8*x+1))==sqrt(8*x+1); x = 1:20; idx = istri(x) x(idx)

plus de 13 ans il y a | 1

| A accepté

Réponse apportée
access outputs of functions with multiple outputs
There *is* a way to do it, but I am reluctant to share it because I don't think it is worthwhile to program this way. I cannot ...

plus de 13 ans il y a | 2

| A accepté

Réponse apportée
reading a song in matlab
Make sure that the file is in the current directory first, then: [Y,FS] = wavread('myfile.wma');

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
for loop to make a taylor series
If you write it as: e^x = x^0/0! + x^1/1! + x^2/2! + .... + x^n/n! then you can see the pattern easier. I don't want to...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
2D Array Manipulation / Script
You can also use <http://www.mathworks.com/matlabcentral/fileexchange/24536-expand expand>, which is written to be more general ...

plus de 13 ans il y a | 0

Réponse apportée
Duplicate the value of a cell for other cells in a matrix
Here is an example; adapt it as needed. A = magic(10); % The array. N = randperm(numel(A)); % Random linear indices....

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
Symbolic solve giving wierd roots
docsearch('rootof') Look at the documentation of SOLVE, scroll down to rootof.

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
How can I plot a symbolic function or determine a finite and real starting guess for fzero?
If you have a function of one variable, you can use my <http://www.mathworks.com/matlabcentral/fileexchange/6924-newtzero newtze...

plus de 13 ans il y a | 1

| A accepté

Réponse apportée
Loops and Complicated Matrix Multiplication
Often times it is easier to figure out such a problem by looking at a simpler version where we can actually keep track manually....

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
stem and set function: A question
set(z,'linewidth',6,'color','r')

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
Find Function in MATLAB to Compare two vectors
Given your example inputs and outputs: % The inputs A = [1, 2, 3, 4, 5].' B = [2, 4, 5, 6, 7;10, 11, 13, 14, 15].' ...

plus de 13 ans il y a | 0

Réponse apportée
Matlab - convert vector to discrete function
You can fit a polynomial to U, or a spline or any function. We must know what the expected relation is, or at least see the gra...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
Heuristic solver for lambert W function?
X = solve('x*(2^x)=b/ln(2)','x'); x_b3 = subs(X,'b',3) % x when b=3

plus de 13 ans il y a | 1

| A accepté

Réponse apportée
Help with 'solve' function in MATLAB for numerical solution!
d = solve('x=(2^x)*b+c'); n = subs(d,{'b','c'},{2,3}) % Put 2 for b, 3 for c If you are doing the substitutions in a lo...

plus de 13 ans il y a | 3

| A accepté

Réponse apportée
Plotting a vertical line using ezplot
This will put a vertical line in the middle of the axes. Adjust as needed. LIM = get(gca,{'xlim','ylim'}); L = line(mea...

plus de 13 ans il y a | 1

| A accepté

Réponse apportée
Can't define functions in Matlab
At the command prompt, type: edit Now paste your code into the window that opens up. Then save it. From the commamd prompt ...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
Avoid for loops with if inside
idx = bsxfun(@minus,A(1,:).',B(1,:))<5; C(idx) = C(idx) + 1; It would help if you specified the sizes of A, B and C. I ...

plus de 13 ans il y a | 2

| A accepté

Réponse apportée
question about matlab code and function......
You might want to read the Getting Started section of the documentation. Also, why would you want the function to only work on ...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
name several curves within a loop
You could put a text on each curve. But placing the text could be tricky with that many curves on one plot. x = 0:.01:1;...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
construct a function which randomly change one bit a column
A = round(rand(4,4)); % The initial matrix. % Given A, use this to change one random element per column. [m,n] = size(A...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
How do you combine multiple commands into a single code for one execution?
Follow these steps. 1) At the command line, type: edit 2) Paste your code into the blank document you opened in ste...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
How to run m-files automatically ?
D = dir('*.jpg'); for ii = 1:length(D) % Put your processing code here. Call image names as below... fprint...

plus de 13 ans il y a | 1

| A accepté

Réponse apportée
Generate permutations of numbers
You can use my <http://www.mathworks.com/matlabcentral/fileexchange/11462-npermutek npermutek>. npermutek([0 1],2) a...

plus de 13 ans il y a | 1

| A accepté

Réponse apportée
A question on input and output arguments in a function, interesting.
Even a one-line function is possible in MATLAB. This is a valid function... function num = myecho(num)

plus de 13 ans il y a | 0

Réponse apportée
Purpose of guidata(hObject,handles)
This stores the variable named 'handles' in the guidata of the object with handle HObject. I assume you saw this in the Ope...

plus de 13 ans il y a | 3

Réponse apportée
Creating a white background behind a subplot that is placed over another sublot
I would simply use a UIPANEL. Here is some code that will run, based on your code. Note the last three lines: h=figur...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
ho to plot multy-axis with Two Y-axis in left hand side?
You can just alter the PLOTYY function: figure x = 0:0.01:20; y1 = 200*exp(-0.05*x).*sin(x); y2 = 0.8*exp(-0.5*x...

plus de 13 ans il y a | 0

| A accepté

A soumis


N_PERMUTE_K
All possible permutations of the elements of set N, taken K at a time, with repetition.

plus de 13 ans il y a | 2 téléchargements |

4.33333 / 5
Thumbnail

Charger plus