Réponse apportée
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 ) = ...

environ 8 ans il y a | 1

| A accepté

Réponse apportée
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...

environ 8 ans il y a | 0

Réponse apportée
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

environ 8 ans il y a | 1

Réponse apportée
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...

environ 8 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 8 ans il y a | 0

Réponse apportée
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...

environ 8 ans il y a | 0

Réponse apportée
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...

environ 8 ans il y a | 1

| A accepté

Réponse apportée
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...

environ 8 ans il y a | 1

| A accepté

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

environ 8 ans il y a | 1

| A accepté

Réponse apportée
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

environ 8 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 8 ans il y a | 0

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

environ 8 ans il y a | 0

| A accepté

Réponse apportée
[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 '...

environ 8 ans il y a | 2

Réponse apportée
[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 ...

plus de 8 ans il y a | 0

Réponse apportée
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, ...

plus de 8 ans il y a | 0

| A accepté

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

plus de 8 ans il y a | 2

| A accepté

Réponse apportée
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 ...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 8 ans il y a | 0

Réponse apportée
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...

plus de 8 ans il y a | 0

| A accepté

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

plus de 8 ans il y a | 1 réponse | 0

1

réponse

Réponse apportée
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!

plus de 8 ans il y a | 0

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

plus de 8 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 8 ans il y a | 2

Réponse apportée
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...

plus de 8 ans il y a | 0

Réponse apportée
Reference to non-existent field 'v'.
I assume you mean p.v_lq rather than p.v.lq

plus de 8 ans il y a | 0

Réponse apportée
How to exit a script but not from MATLAB?
doc return should do the job.

plus de 8 ans il y a | 0

Réponse apportée
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...

plus de 8 ans il y a | 1

Réponse apportée
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...

plus de 8 ans il y a | 0

Réponse apportée
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...

plus de 8 ans il y a | 0

Réponse apportée
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...

plus de 8 ans il y a | 0

| A accepté

Charger plus