Answered
MATLAB : dynamic variables not updated directly in the workspace
Why don't you just create an array instead of a sea of variables? ['x_',num2str(i))]= fonction(input); is not valid synt...

11 years ago | 0

Answered
How to assigned to a variable vector of the cell?
Please try to include information on any errors with questions like this. Just saying "without success" doesn't really make it ...

11 years ago | 0

| accepted

Answered
is there a way of scanning an array to find out what there is in there so i dont reinsert the same variable in there?
In response to your latest comment... C = setdiff(A,B,'rows'); should do what you want, assuming your pse array also has...

11 years ago | 0

Answered
Call on Dynamic Variable
Similar question, similar answer: http://uk.mathworks.com/matlabcentral/answers/183258-how-to-call-variables-with-consecutive...

11 years ago | 0

Answered
How do I interpolate a value from two sample vectors and two actual vectors?
>> g = griddedInterpolant( rpm, torque ); >> g( 1777 ) ans = 331.264 should do the trick. ...

11 years ago | 0

Answered
using parse to deal with input arguments
Does it not work to just replace isscalar(x) with something like validationFcn = @(x) isempty(x) || isscalar(x); ...

11 years ago | 0

Answered
piecewise function evaluation using if-else statement
You can't use an if statement on a vector (or rather you can, but it is usually not the effect you wish to achieve, as in this c...

11 years ago | 0

Answered
How to call variables with consecutive names?
Don't do it. Just use an array. It is what they are for. var(1), var(2), var(3), etc or if you have different sized va...

11 years ago | 3

Answered
How do i convert a .m file to a GUI
You can use Guide to create a GUI and then call your .m file function from a callback of a pushbutton or whatever control you wa...

11 years ago | 0

Answered
How does the cycle for , if work?
K=[-2,5,-5]; n = 0:10' res = bsxfun( @plus, K, n' ); resSum = sum( res, 2 ); zeroSums = resSum == 0; n( zer...

11 years ago | 0

Answered
Black image getting saved while using imsave
Just scale it up to use the full 16-bit range before you save it. i.e. multiply by 65535/957 but replacing the hard-coded ...

11 years ago | 0

Answered
how to write code to find y???
y = [-1 1] .* sqrt( x - 2 ); This is maths rather than Matlab though. Once you rearrange the equation the Matlab code for ...

11 years ago | 0

Answered
Error using vertcat (dimension of matrices concatenated are not consistent)
z0 is an array of values because w is an array of values. So it is not a scalar and cannot therefore be concatenated as: ...

11 years ago | 0

Answered
is there a way of scanning an array to find out what there is in there so i dont reinsert the same variable in there?
find( myArray == newNumber, 1 ); If that returns true the number is already there, if not it isn't.

11 years ago | 0

Answered
Interp1 error - grid vectors are not strictly monotonic increasing.
The data in your data sets must be in a strictly increasing order - i.e. each element must be strictly greater than the previous...

11 years ago | 0

| accepted

Answered
how to make values global in matlab gui?
Your code will allow handles.folder = 'myfolder'; to be accessible in any callback. The code you wrote after that is ju...

11 years ago | 0

| accepted

Answered
Placing 2 related GUI's
Launch your second gui as: hFig2 = SecondGUI; set( hFig2, 'Position', [x y width height] ); where [x y width height] ...

11 years ago | 1

| accepted

Answered
output tic/toc functions ?
The documentation says it returns time in seconds. I only ever use tic toc for an approximate idea of time though and usually...

11 years ago | 0

| accepted

Answered
How do I execute this script as a function?
set( hPushButton, 'Callback', @(src,evt) func( allf ) ) where you create the pushbutton (obviously you can just add it to t...

11 years ago | 0

Answered
finding if a digit repeats itself an equally at 2 different numbers
r = ~x should do the trick if x is the difference that can be 0 or greater

11 years ago | 0

Answered
gui run command only if another input has been done
Do you mean you want to run the command when you press pushbutton2? In which case just put it in the callback for pushbutton2. ...

11 years ago | 1

Answered
How to store every iteration points of GA in m-file?
<http://uk.mathworks.com/help/gads/ga.html#outputarg_output> seems to be the output argument you need. I don't have the opti...

11 years ago | 0

Answered
Simple question about sum function
X = 1:10 Y = X + 1; sumRes = sum( Y ); for e.g. X from 1 to 10

11 years ago | 1

Answered
How to preallocate memory for building this structure, indexing fieldnames?
Why do you need to pre-allocate? Aren't you simply copying values from one struct to another without any dynamic resizing going...

11 years ago | 1

Answered
Why the error: Assignment has more non-singleton rhs dimensions than non-singleton subscripts???
matrice(60,10,t) is just a single element of your array that you are trying to assign to. matrice(:,:,t) = ... ...

11 years ago | 0

| accepted

Answered
Cell contents assignment to a non-cell array object?
tester = (round(NumberOfElementsInBigMatrix/2)); will create *tester* as a double array. Then later on you try to assign t...

11 years ago | 0

| accepted

Answered
accessing data from handles structure from a call back fuction
You need to add guidata( hObject, handles ); at the end of your pushbutton1_Callback. Then in pushbutton2_Callback yo...

11 years ago | 0

Answered
How can I select a default folder?
I just change the 'Start in' directory in the properties for Matlab for the shortcut I use to open it.

11 years ago | 0

Answered
All Indices of all Numbers in Array
maxElem = max( A(:) ); res = cell( maxElem, 1 ); for i = 1:max( A(:) ) res{i} = ceil( find( A' == i ) / 3 ); end ...

11 years ago | 0

Answered
Please help, logical indexing of 3D matrices
(Edited version as in comments below - original edit was incorrect!) C = zeros( size(B) ); ind2d = find(B); C( in...

11 years ago | 0

Load more