Answered
Perofrming statistics over non-zero elements of mXn array
array( array == 0 ) = NaN; nanmean( array )

9 years ago | 0

Answered
How can I change the tick labels in a colorbar
figure; hAxes = gca; imagesc( hAxes, rand( 25 ) ); hc = colorbar( hAxes ); hc.TickLabels = arrayfun( @num2str, hc.Tic...

9 years ago | 1

| accepted

Answered
Plotting opened data in GUI
You need to take a read of this: <https://uk.mathworks.com/help/matlab/creating_guis/share-data-among-callbacks.html> A GU...

9 years ago | 0

| accepted

Answered
How to convert Matlab scatterplot axis to display pixels
Set the XLim and YLim properties of your axes to match the 'Position' property of your axes (doing the obvious maths to go from ...

9 years ago | 0

| accepted

Answered
Colour Code Points Based on (x,y) Coordinates
hsvColour = [x * 0.9, y, ones(100,1)]; xyColour = hsv2rgb( hsvColour ); Or some variation on the theme maybe gives a bri...

9 years ago | 0

| accepted

Answered
Logical left shift and truncate bit length
Just throw away the first element of the array e.g. res = dec2bin( bitshift( 135, 1 ) ); res = res( 2:end );

9 years ago | 0

Answered
How to use imhist() for a part of an image
e.g. imhist( I(200:300, 320:420) )

9 years ago | 1

| accepted

Answered
Issue using ScrollPanel function not plotting all axes
Try setting hFig.Renderer = 'painters'; where hFig is your figure handle.

9 years ago | 0

Answered
Why is GUI window closed after push the pushbutton?
clc; close all; clear; Why would you ever put these in a pushbutton callback? close all is what closes your...

9 years ago | 1

Answered
Set date limits into x-axis
doc xlim What is wrong with just using this to set the limits?

9 years ago | 0

Solved


Combine the first and last names
MATLAB R2016 provides a rich set of functions to work with string arrays. In this problem, you will be given two string arrays o...

9 years ago

Answered
"Not enough input arguments error"
Surely this is obvious from the error. It tells you exactly what the problem is. You are calling your function with no argumen...

9 years ago | 0

Answered
Select file issue in Matlab GUI
Declare handles.hImage = []; guidata( hObject, handles ) in your OpeningFcn Then when you plot: handles.hImag...

9 years ago | 0

Answered
What does it mean when it is said that a struct is a 2-by-3 struct?
It means it is a 2x3 matrix of struct objects - i.e. 6 objects of a struct, arranged in 2 rows and 3 columns

9 years ago | 1

Answered
finding and changing values in matrix that satisfies 2 conditions
idx = find( A > 0 ); idx = idx(2:2:end); B = A B(idx) = 100;

9 years ago | 1

| accepted

Answered
Advise on how to structure different classes. I'm OO newbie
Don't have a calculator class inherit from a data class. Either just give public access to what is in the data class, give ac...

9 years ago | 0

| accepted

Answered
Unbalanced or unexpected parenthesis or bracket.
x=[1 4 5 ^ - 8 + 5 4 * -] is not valid code. If you want an array of characters you have to use e.g. '1', '4',...'*' As...

9 years ago | 1

Answered
Parallel Computing, cores, parfor
Is it necessary for me to have the Parallel Computing Toolbox installed to execut parallel calculating to save time? *Yes* ...

9 years ago | 0

Answered
How to pass parameters between callback (GUI) in different buttongroup
The reason why ought to be quite simple as you basically said it yourself, you just maybe didn't realise. The buttons are in ...

9 years ago | 1

Answered
how to convert a table to vectors where each vector takes the name of the column in the table
Why would you need your vectors named that? How are you planning to work with these vectors afterwards given that their names c...

9 years ago | 0

Answered
Average curve of 150000x7 matrix
doc mean The second argument allows you to specify the dimension along which the mean is calculated

9 years ago | 0

Answered
how to plot complex signal from i(inphase) q(Quadrature phase) values in matlab?
figure; hAxes = gca; plot( hAxes, I ) hold( hAxes, 'on' ) plot( hAxes, Q, '--' )

9 years ago | 0

| accepted

Answered
Replace values in a matrix below 1% and above 99%
lowPercentileVal = prctile( myMatrix(:), 1 ); myMatrix( myMatrix < lowPercentileVal ) = lowPercentileVal; highPercentile...

9 years ago | 1

| accepted

Answered
How to index this structure
[~,matchingIdx] = ismember( [file.Position], 100:150 ); or [~,matchingIdx] = ismember( 100:150, [file.Position] ); ...

9 years ago | 1

| accepted

Answered
How much codegen speed up the performance ? Please give numbers!!!
Matlab compiler creating an executable may have some effects on speed (either faster or slower), but as far as my experience goe...

9 years ago | 0

Answered
Using a variable value as linear array index
Yes B(C) will use C to index into B, it doesn't multiply at all. Surely you could just try this out on the command li...

9 years ago | 0

| accepted

Answered
Looping Over Cell Array with if statements
if cell{k}(:,6) > percentile(k) is not going to do what you want unless cell{k}(:,6) evaluates to a scalar which I assume i...

9 years ago | 0

Answered
Problem with arguments in function call - button
When you use this syntax for a callback 'Callback', @VerCallback The callback function will have exactly 2 input argumen...

9 years ago | 0

Answered
How to plot f(x) =|x| in matlab
doc abs doc plot The rest is trivial. I assume you know how to create a variable. You just need to create one for x an...

9 years ago | 0

Answered
Change the color of streamslice
load wind figure h = streamslice(x,y,z,u,v,w,[],[],[5]); axis tight set( h, 'Color', [0 0 0] ) % or set( h, 'C...

9 years ago | 0

| accepted

Load more