Answered
"Pixel Color"
data = magic(30); figure; h = imagesc( data ); h.AlphaData = data > 100; You can do the same in your case, just keep ...

8 years ago | 1

| accepted

Answered
how can slect randomly numbers from two array s
idx = randperm(10,5); C = [A, B]; selectedNums = C(idx); or to be a little more generic and avoid ugly hard-coded...

8 years ago | 0

Answered
Iteration for loop cell array storage
This seems rather obvious, but it is often the obvious things that are hardest to see... Nothing in your for loop depends on ...

8 years ago | 0

Answered
Does "clear" command clears the global variables
doc clear gives a very clear description of the various arguments to clear and what gets cleared by each instruction. Si...

8 years ago | 3

| accepted

Answered
How to use latex interpreter for xticklabels?
hAxes.TickLabelInterpreter = 'latex'; assuming you are using >= R2014b, where hAxes is your axes handle

8 years ago | 7

| accepted

Answered
What is the fastest way to plot 4 separate graphs with equal y parameters?
hAxes(1) = subplot(2,2,1); plot( hAxes(1), 1:length(x),x(6,:)) hAxes(2) = subplot(2,2,2); plot( hAxes(2), 1:length(y)...

8 years ago | 1

Answered
Changing order of elements of one vector depending on the order of another vector
[sortedA, idx] = sort( a ); sortedB = b(idx); When you look at something like doc sort which, by the way, is the...

8 years ago | 1

| accepted

Answered
Hi I'm creating a GUI for part of an image processing project. To this point I have one push button that reads in an image (and does something with it), and another push button that will then convert that image into a binary image now how to allow
<https://uk.mathworks.com/help/matlab/creating_guis/share-data-among-callbacks.html This> is an important source to read and und...

8 years ago | 0

| accepted

Answered
find index conditional on two vectors
find( resp == 1 & fing == 1 ); If you don't need the actual linear indices though then the logical vector returned by just ...

8 years ago | 1

| accepted

Answered
How can I set a variable alpha channel to an image?
You can use a mask image of the same size as your main image, filled with 0-1 values to give any level of transparency on a per-...

8 years ago | 1

| accepted

Answered
How can i skip the files which are not present in a for loop?
doc exist e.g. if exist( 'someFilename', 'file' ) % Do something else % Don't do something end

8 years ago | 1

Answered
Is it possible to create your own structure array in a GUI that can be referenced within the GUI?
<https://uk.mathworks.com/help/matlab/creating_guis/share-data-among-callbacks.html> Just add your structure to 'handles' as ...

8 years ago | 0

| accepted

Answered
Convert GPUArray back to regular array?
doc gather Make sure you select the one for the parallel computing toolbox though rather than tall arrays

8 years ago | 1

| accepted

Answered
How to use two seperate colorbars on the same plot.
You don't need two different colourmaps for that - you can join together two colourmaps yourself into a single one e.g. ...

8 years ago | 1

Answered
Storing multiple matrices in an array
Depends how you want them to end up. You can pack them into a numeric array of one higher dimension or a cell array (in which i...

8 years ago | 0

Answered
How to sum two rows at a time in matrix
sum( reshape( A', 6, 3 ) )

8 years ago | 1

| accepted

Answered
If I start with a matrix of zeros, how can I easily create a triangle of ones in that matrix?
It depends where you want the triangle. For example res = tril( ones(100) ); will produce a triangle in the lower left ...

8 years ago | 0

Answered
Data cursor: Let Y coordinate increase instead of decrease (moving from bottom to top)
Flip your image in the vertical dimension before plotting it, e.g. figure; hAxes = gca; imagesc( hAxes, flip( myImage, 1 ) ...

8 years ago | 0

Answered
Populate listbox with only directories?
S = dir( pathName ); N = { S( [ S.isdir ] ).name }; N = N( ~cellfun( @(x) strcmp( x, '.' ) || strcmp( x, '..' ), N ) ); ...

8 years ago | 0

| accepted

Answered
How do I do a logic check to see if one or more entries in an array is below a certain value?
logicalIdx = Fan.data(:,2) < 8000; dates = Fan.data(logicalIdx,1);

8 years ago | 1

| accepted

Answered
How to clear variable from GUI?
handles.data = []; will reset the field to empty (which is what I usually do because I use an isempty(...) test when using ...

8 years ago | 0

Answered
Why am I getting the error "Error using * Inner matrix dimensions must agree"? (details in the description)
T = Mat * Hie'; will give you a 2000x1 result. Whether it is the one you want or not is another matter.

8 years ago | 0

Answered
error in using strcmp
You spelled the function name wrong (though managed to spell it correctly in your question tag!) strcmpi is what you nee...

8 years ago | 0

| accepted

Answered
How to isolate between two axes handlings.
As with most plotting functions, compass takes the axes handle as it's first argument if you choose to use this (which you shoul...

8 years ago | 0

Answered
gui slider disappears from figure
Problems with sliders disappearing usually come with a warning on the command line and are often associated with setting an ille...

8 years ago | 0

| accepted

Answered
Should i remove one MATLAB Compiler Runtime if i have two ones
There is a one-to-one relationship between MCR version and Matlab versions so if you have executables compiled from a given vers...

8 years ago | 1

Answered
I want to plot the convolution of this two signals but it does not work.Here is my code.
Use the 'same' flag if you want your convolution to be the same size as the original signal - i.e. c = conv( G, d, 'same' )...

8 years ago | 0

Answered
How to format the xAxis of subplots?
hAxes(1) = subplot(4,1,1) ... hAxes(2) = subplot(4,1,2) etc will allow you to keep the axes handles which you can ...

8 years ago | 0

| accepted

Answered
How to upcast an object?
You would have to implement your own <https://uk.mathworks.com/help/matlab/matlab_oop/concatenating-objects-of-different-classes...

8 years ago | 0

Load more