1,664 total contributions since 2014

Professional Interests: Signal Processing, OOP, Matlab GUI programming

Answered

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

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

3 days 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, ...

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

4 days ago | 0

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

GUI: how to make radio button with multiple lines

Use html for the 'String', e.g. '<html>This is a multiline<br>string</html>'

10 days ago | 1

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

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

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

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

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

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

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

1 month ago | 1 answer | 0

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!

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!

1 month 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 ); ...

Changing colors using imagesc

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

2 months ago | 0

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

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

2 months ago | 1

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

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

3 months ago | 0

Answered

Reference to non-existent field 'v'.

I assume you mean p.v_lq rather than p.v.lq

Reference to non-existent field 'v'.

I assume you mean p.v_lq rather than p.v.lq

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

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

3 months ago | 1

Question

Injecting a custom plot function into SOM training

Is there any possibility to inject my own plotting function (or more generally any kind of function handle) to be called at the ...

3 months ago | 0 answers | 0

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

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

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

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

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

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

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

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

3 months ago | 0

| accepted

Answered

Can somebody help me with this script?

iscell checks if you have a cell array. uigetfile will return a cell array if multiple files are selected, otherwise it wi...

Can somebody help me with this script?

iscell checks if you have a cell array. uigetfile will return a cell array if multiple files are selected, otherwise it wi...

3 months ago | 0

Answered

Passing workspace variable to matlab App Designer

<https://uk.mathworks.com/matlabcentral/answers/284140-call-an-mlapp-with-input-argument-s This thread> gives a workaround for t...

Passing workspace variable to matlab App Designer

<https://uk.mathworks.com/matlabcentral/answers/284140-call-an-mlapp-with-input-argument-s This thread> gives a workaround for t...

3 months ago | 1

| accepted

Answered

Write a function to calculate the area of a circle

It isn't obvious from point 4 if it is expected that you just output -1 if any input is negative or -1 in only that location, bu...

Write a function to calculate the area of a circle

It isn't obvious from point 4 if it is expected that you just output -1 if any input is negative or -1 in only that location, bu...

3 months ago | 0

| accepted

Answered

Does "mex" function require a specific toolbox?

mex only requires base Matlab, no additional toolboxes.

Does "mex" function require a specific toolbox?

mex only requires base Matlab, no additional toolboxes.

3 months ago | 0

Answered

What frustrates you about MATLAB?

Most frustrating thing for me at the moment is at times Matlab starts endlessly beeping at me with the error sound. At first I ...

What frustrates you about MATLAB?

Most frustrating thing for me at the moment is at times Matlab starts endlessly beeping at me with the error sound. At first I ...

4 months ago | 0

Answered

How to choose divisible numbers for a data?

doc factor will give you prime factors. You can take it from there to decide your own factors.

How to choose divisible numbers for a data?

doc factor will give you prime factors. You can take it from there to decide your own factors.

4 months ago | 0

Answered

how to convert a single row matrix into a number (double)

a = [1 2 3 4 5]; str2double( strrep( num2str( a ), ' ', '' ) ) works, but I'm sure there are more elegant or robust ways...

how to convert a single row matrix into a number (double)

a = [1 2 3 4 5]; str2double( strrep( num2str( a ), ' ', '' ) ) works, but I'm sure there are more elegant or robust ways...

4 months ago | 0

Answered

Fitting to a homemade function

x = lsqcurvefit(@(D, xData) MyFun( a, H, D, xdata ),ydata ) should work, I think...

Fitting to a homemade function

x = lsqcurvefit(@(D, xData) MyFun( a, H, D, xdata ),ydata ) should work, I think...

4 months ago | 0

Answered

Selection of greater than or less than symbol in app

I would just use a single if statement to get your operand as a string and convert it to a function handle, e.g func = ...

Selection of greater than or less than symbol in app

I would just use a single if statement to get your operand as a string and convert it to a function handle, e.g func = ...

4 months ago | 1

| accepted

Answered

GUI elements locations has changed position

If you are using GUIDE there is an Object Browser in the View menu that allows you to gain access to every component, even if it...

GUI elements locations has changed position

If you are using GUIDE there is an Object Browser in the View menu that allows you to gain access to every component, even if it...

4 months ago | 0

| accepted

Answered

For loop ranging from negative to positive integers?

Just create an array of e.g. inputVals = -12:20; Then use indices in your loop: for i = 1:numel( inputVals ) A...

For loop ranging from negative to positive integers?

Just create an array of e.g. inputVals = -12:20; Then use indices in your loop: for i = 1:numel( inputVals ) A...

4 months ago | 0