Answered
How can I write a command in matlab to simplify series of commands?
resA = output( :, 1:14, 60 );

10 years ago | 0

| accepted

Answered
How come 10^-N does not equal 1e-N for some N ?
floating point maths is not exact. There are numerous places on the web where you can read up about this. It isn't specific to...

10 years ago | 2

| accepted

Answered
Accessing all the values of a specific structure field in a matrix of structure to a cell array.
All_a(x,:) = { RList.a }; will give you all elements of your RList array's 'a' field in a 1d cell array. To get the 2d c...

10 years ago | 0

Answered
how can I modify a command to make it able to read a comma separated file?
doc dataset should lead you to the help page which includes information on the 'Delimiter' parameter name/value pair so you...

10 years ago | 0

| accepted

Answered
Matlab locks avi movie.
Are you using a pre 2010b version of Matlab? If not then you should be able to use VideoWriter instead as movie2avi will be r...

10 years ago | 0

| accepted

Answered
How do I do two animated lines in two different figures?
Did you look at the documentation for animatedline? Like all plotting functions it allows you to specify an axes on which to pl...

10 years ago | 0

| accepted

Answered
Need help in uderstanding this piece of code
idx defines the row of the 'output' matrix being written to and ':' says to just fill as many columns in that row as there are o...

10 years ago | 0

| accepted

Answered
error 'not enough input arguments" at line with dx..
How are you calling your function? If you just click Run then you will obviously get this. That is a function that takes argum...

10 years ago | 0

Answered
Remove an element from a vector, using most computationally efficient solution
Are you not able to create a logical vector pointing to the elements that should be removed and then remove them all at once at ...

10 years ago | 0

Answered
Why is my griddedInterpolant not working properly?
You need to transpose your DUR5 matrix when you use griddedInterpolant because you are giving it X and Y vectors, but your matri...

10 years ago | 0

| accepted

Answered
My closereq function is empty. How can i replace it?
function closereq %CLOSEREQ Figure close request function. % CLOSEREQ deletes the current figure window. By default,...

10 years ago | 1

| accepted

Answered
How to build a mex return structure?
You can create an mxArray as you would anywhere else, e.g. mxArray* myArray = mxCreateDoubleMatrix( 3, 4, mxREAL ); doub...

10 years ago | 1

| accepted

Answered
Continuous slider callback, not updated handles in callback function.
Passing handles around is not a good idea because it is passed by value, so as you have seen, anything added after does not come...

10 years ago | 0

| accepted

Answered
Mex mxClassID not found
You just spelt it wrong with a 'c' instead of an 'x' mxCreateNumericMatrix

10 years ago | 0

| accepted

Answered
Add 8 to the elements of matrix a=[1 7 5 7 2 3 8 2 9 5] that are higher than 3
a( a > 3 ) = a( a > 3 ) + 8

10 years ago | 1

| accepted

Answered
Using function 'save'.
save is used to save to a .mat file or an ascii file. If you want to save to an excel spreadsheet I would suggest to use ...

10 years ago | 0

| accepted

Answered
How do I convert the dimesion of a matrix from 1 m n to m n?
doc squeeze

10 years ago | 0

| accepted

Answered
How to use SplashScreen with my GUI?
You should just be able to insert the code given in the example into the OpeningFcn of a GUIDE GUI. Put the creation code as ...

10 years ago | 0

Answered
How to translate image and pad border ?
You could do this manually just as mat = [ 1 2 3; 4 5 6; 7 8 9 ]; res = [ mat(:,1), mat(:,1:end-1) ];

10 years ago | 0

Answered
Missing subplots inside a panel
Works fine for me using axes rather than subplot in R2015a too so doesn't look like a version issue.

10 years ago | 0

| accepted

Answered
How is it possible to call C Function in MATLAB Script files?
doc 'MEX File Creation API' gives information on this. It isn't trivial so you need to read up on it and then feel free to...

10 years ago | 0

| accepted

Answered
Missing subplots inside a panel
I very rarely use subplot and that behaviour I cannot understand on stepping through. However, you do not need to complicate is...

10 years ago | 0

Answered
How to add matrix to previous matrices after every iteration?
Why don't you just use a 1x2 matrix if all the rest of the points will always be 0? Either way I don't really get the problem...

10 years ago | 0

Answered
How to create a file .txt from a matrix?
fid = fopen( 'somefile.txt', 'w' ); fprintf( fid, '%d %.1f %.1f\n', [y_training x_training ]'); would give what you want...

10 years ago | 0

Answered
Objects getting deleted between user functions
You need this line after creating your handles.cpp guidata( hObject, handles ) Unless you have just missed some code out...

10 years ago | 0

Answered
Slider with non consecutive values
If you have your slider values in an array then just map onto them and use the id (which is consecutive) into the array as the v...

10 years ago | 1

| accepted

Answered
Using 'xlswrite' to save excel file to a PRE-SPECIFIED folder
doc fullfile e.g. pathName = 'D:\myFiles'; filename = 'SomeFilename.xls' fullPath = fullfile( pathname, filename...

10 years ago | 0

Answered
how can I sort the arrays according to example I explained below?
[Result, idx] = sort( Result ); CoEff = CoEff( idx, : );

10 years ago | 1

| accepted

Answered
How can I set the 'Xticks' to the bound of the colours in a colorbar?
nTicks = 6; range = 6 - 1; inc = range / nTicks; ticks = ( 0:nTicks ) * inc + 1; Then set these as XTick

10 years ago | 0

| accepted

Answered
Which code will be faster?
Loading the into memory should be faster if they fit in memory. It is easy to test the speed of both of them for yourself thoug...

10 years ago | 0

| accepted

Load more