Beantwortet
Removing Elements from an Array based on their Position for every 3 Elements
If you are using R2015a or later then this will work: elements_n = repelem( elements_n, 3 ); Arr( Arr == elements_n ) = ...

mehr als 8 Jahre vor | 1

| akzeptiert

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

mehr als 8 Jahre vor | 0

Beantwortet
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

mehr als 8 Jahre vor | 1

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

mehr als 8 Jahre vor | 0

| akzeptiert

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

mehr als 8 Jahre vor | 0

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

mehr als 8 Jahre vor | 0

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

mehr als 8 Jahre vor | 1

| akzeptiert

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

mehr als 8 Jahre vor | 1

| akzeptiert

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

mehr als 8 Jahre vor | 1

| akzeptiert

Beantwortet
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

mehr als 8 Jahre vor | 0

| akzeptiert

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

mehr als 8 Jahre vor | 0

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

mehr als 8 Jahre vor | 0

| akzeptiert

Beantwortet
[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 '...

mehr als 8 Jahre vor | 2

Beantwortet
[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 ...

mehr als 8 Jahre vor | 0

Beantwortet
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, ...

mehr als 8 Jahre vor | 0

| akzeptiert

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

mehr als 8 Jahre vor | 2

| akzeptiert

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

mehr als 8 Jahre vor | 0

| akzeptiert

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

mehr als 8 Jahre vor | 0

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

mehr als 8 Jahre vor | 0

| akzeptiert

Frage


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

mehr als 8 Jahre vor | 1 Antwort | 0

1

Antwort

Beantwortet
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!

mehr als 8 Jahre vor | 0

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

mehr als 8 Jahre vor | 1

| akzeptiert

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

mehr als 8 Jahre vor | 2

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

mehr als 8 Jahre vor | 0

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

mehr als 8 Jahre vor | 0

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

mehr als 8 Jahre vor | 0

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

mehr als 8 Jahre vor | 1

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

mehr als 8 Jahre vor | 0

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

mehr als 8 Jahre vor | 0

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

mehr als 8 Jahre vor | 0

| akzeptiert

Mehr laden