Answered
How Can I create exe file of GUI program (.fig, .m)
For the second question, no, you create an exe for your top level function and it will bring in all the dependencies it needs (t...

7 years ago | 0

Answered
How to calculate standard deviation and mean ?
Use S = std( a, 'omitnan' ) M = mean( a, 'omitnan' ) if you don't want NaNs in your statistic

7 years ago | 1

Answered
How to remove callback from a java component?
Ok, I understand the problem now. I'll leave my previous answer in since it was related to the question in the title, even thou...

7 years ago | 0

| accepted

Answered
How do you save parameters for a stereo camera
doc save As the help and error says, you need to pass a string with the variable name in: save( StereoCalFileName, 'Va...

7 years ago | 0

Answered
How to remove callback from a java component?
set(handles.jsh,'StateChangedCallback',[]) seems to work fine for me when I tested it out on a java slider, using square bra...

7 years ago | 0

Answered
Find smallest imaginary values of a vector of real and complex number
Something like this would do it, albeit with some better variable naming and handling of error cases. [~, idx] = sort( nonz...

7 years ago | 1

| accepted

Answered
How to find the x&y co-ordinates of the highest peak and storing the data into a variable
If you just want the highest peak can't you just use doc max ? with the 2 output syntax to get the index which you can t...

7 years ago | 1

| accepted

Answered
UISTACK doesn't recognize handle
hImage = imagesc(output_image); % Plot image uistack( hImage, 'bottom'); You need to keep the graphics handle output of ...

7 years ago | 1

| accepted

Answered
Difference between two iteration of for loop
diff( P ) after the for loop should do this for you for all pairs of consecutive elements of P

7 years ago | 0

| accepted

Answered
Find the longest sequence of consecutive non-zero values in a vector
<https://uk.mathworks.com/matlabcentral/fileexchange/41813-runlength> or other similar run length functions should help, espe...

7 years ago | 0

Answered
insert a Background without guide
f=figure('Position',get(0,'screensize')); as=axes('Parent',f,'Units', 'pixels', 'Position',[400 200 200 150]); i...

7 years ago | 0

| accepted

Answered
[DISCONTINUED] MATLAB Answers Wish-list #4 (and bug reports)
Hopefully this is still work in progress, but the options for asking a question are a little odd at the moment. I notice that '...

7 years ago | 2

Answered
[DEPRECATED] What frustrates you about MATLAB?
A minor irritation, but still a bit annoying. Matlab's editor is obviously very lacking when it comes to refactoring tools and ...

7 years ago | 0

Answered
Changing the x,y axis values
Set the XData (and YData if required) properties of your image, either when first creating it as e.g. image( hAxes, 1:360, ...

7 years ago | 0

| accepted

Answered
GUI: how to make radio button with multiple lines
Use html for the 'String', e.g. '<html>This is a multiline<br>string</html>'

7 years ago | 2

| accepted

Answered
Problem with error "Subscript indices must either be real positive integers or logicals"
Use Y = y( round( Ty ) ); to ensure they are actually integers. at least one of them must have decimal values, however ...

7 years ago | 0

| accepted

Answered
Why my plot does not appears in axes in GUI
Whenever you issue any plotting instruction you should always give the axes explicitly to avoid this kind of unexpected occurren...

7 years ago | 0

Answered
How to set X axis limit as 10 to power 1 up to 10 to power 5
set( hAxes, 'XScale', 'log' ) will give you the logarithmic axes scale which you can combine with XLim. I can't remember o...

7 years ago | 0

| accepted

Question


Freezing a plot while updating data
Does anyone know if there is an option that is essentially the opposite of drawnow that I can use to tell my plot not to draw un...

7 years ago | 1 answer | 0

1

answer

Answered
How to convert a 2D matrix to a 3D matrix without for cycles?
M3 = permute( reshape( M2', N, J, K ), [1 3 2] ); should do it I think, though there may be neater ways!

7 years ago | 0

Answered
Changing colors using imagesc
Create your own colourmap, e.g data = round( 2 * ( rand(20) - 0.5 ) ); figure; hAxes = gca; imagesc( hAxes, data ); ...

8 years ago | 1

| accepted

Answered
Passing predefined variables into matlab's fit function
Use anonymous functions, e.g. f = @(x,y) x + y; g = @(y) f(4,y); turns f, a function of 2 variables into g, a functio...

8 years ago | 2

Answered
How do I add ActionPostCallback to GUI axes
Both zoom and pan should take a figure handle, which, by default, will be handles.figure1 in a callback (or in the Openi...

8 years ago | 0

Answered
Reference to non-existent field 'v'.
I assume you mean p.v_lq rather than p.v.lq

8 years ago | 0

Answered
How to exit a script but not from MATLAB?
doc return should do the job.

8 years ago | 0

Answered
Adjusting bar colours in plot
Try editing the 'ColorOrder' property of your axes to define 13 colours rather than the default 7 before you do the plotting. H...

8 years ago | 1

Answered
Can anyone help with vertcat?
vx=linspace(-10,10,1000); returns an array with 1 row and 1000 columns. You would need to use V=[vx';1;2]; to ad...

8 years ago | 0

Answered
Not Enough Input Arguments in ODE Solver
You only call the function with 11 input arguments, the function definition takes 12, which in itself is far too many in general...

8 years ago | 0

Answered
How to pass a variable to a function in GUI?
<https://uk.mathworks.com/help/matlab/creating_guis/share-data-among-callbacks.html> Personally I use guidata if I am creatin...

8 years ago | 0

| accepted

Answered
How to pass an argument for a function when it is an argument in another function?
If r is definied beforehand you can create a function handle that turns your 2-argument function into a 1-argument function e.g....

8 years ago | 0

| accepted

Load more