Answered
I have an image with red,yellow and green pixels. How can I find the percentage of yellow pixels?
yellow = red == 255 & green == 255; if you are using a uint8 image or replace 255 with whatever the data maximum is otherwi...

10 years ago | 0

| accepted

Answered
uitabgroup with tabs from different .fig files
The problem is that what is defined in a .fig will always be a figure, not a panel that can simply be parented by your tab. A f...

10 years ago | 0

| accepted

Answered
Why is guidata not working for me??
The problem here is that handles is a struct and is copied by value, not updated by reference. Whenever you access handles you ...

10 years ago | 1

| accepted

Answered
how do i prompt
rowCol = input( 'Enter row and column\n' ); would work if the user inputs something like: [9 8]; Or you could split...

10 years ago | 1

Answered
error C1083: Cannot open include file: 'mex.h': No such file or directory
You have to setup your include directories in Visual Studio in order for it to know where to find header files to include. This...

10 years ago | 0

Answered
mwArray structure index explaination
I tend to use mxCreateStructMatrix to create a struct, but I guess your syntax works just as well, judging from the help...

10 years ago | 0

Answered
GUI - 'For' loop not working correctly
Strings order alpha-numerically so anything starting with 9 will come after anything starting with 1, irrespective of whether it...

10 years ago | 0

Answered
Can't get windowButtonMotionFcn to work
You need to use @obj.mouse in your call to create the figure because the function is part of your class and so needs to have the...

10 years ago | 2

| accepted

Answered
FLOPS in Complex Array Multiplication
doc timeit Put the multiplication in a function, use timeit and divide the number of floating point operations (easy to cal...

10 years ago | 0

Answered
How to get the current variable value in Matlab GUI?
From what I can see at a quick glance, your handles.c is growing in the loop (i.e. it is a vector of values) and therefore so is...

10 years ago | 0

| accepted

Answered
The plot disappears if I change xlim
plot( x, y ) is the normal form of the plot function so just use that as e.g. plot( K(:,2), K(:,1) ) if you want th...

10 years ago | 0

Answered
Undefined function or variable 'I'
http://uk.mathworks.com/help/matlab/creating_guis/share-data-among-callbacks.html

10 years ago | 0

Answered
How to use path in a script in which another script is loaded?
Add your folders to your path and save it. You don't need to cd in code to change directories when calling a function. There...

10 years ago | 0

Answered
how to fix my guide m file
Open your fig in GUIDE, double click on Axes1, find the 'CreateFcn' property, select all the text in that field and delete it. ...

10 years ago | 1

Answered
How can I add several graphics to a single GUI.
All those functions take an explicit axes handle as an argument, e.g. hold( handles.axes2, 'on' ) label( handles.axes2,....

10 years ago | 0

| accepted

Answered
Can I dynamically change a structure name
Use the version of load with an output argument - i.e. loadedStruct = load( currPath ); Then you will get the contents o...

10 years ago | 1

| accepted

Answered
Extracting 'y' values from plot over an iterating loop
Well if freq and psd are 2d matrices then interp1(freq,psd,freq_10); is not going to work because interp1 expects vector...

10 years ago | 0

Answered
how to sum column of matrix?
idx = bsxfun( @eq, a, t' ); percent = 100 * sum( any( idx, 2 ) ) / numel( t ); would work for your second example. ...

10 years ago | 0

| accepted

Answered
How to make a loop to the if else situation ?
idx = num2str( ceil( idxi / 5 ) ); works if you will always have 5 images in each group and continue that same logic.

10 years ago | 1

| accepted

Answered
How can I create the following vector??
r = repmat( 30, [numel(y), 1] ); or r = 30 * ones( numel(y), 1 ); or r = 30 + zeros( numel(y), 1 ) ); I hav...

10 years ago | 0

Answered
Find coordinates of pixels from vector containing numbers of pixels
doc ind2sub

10 years ago | 0

| accepted

Answered
basic question: how do i keep counting up numbers in a vector?
>> a = [2 3 2 3 2 3]; >> B = cumsum( a ) B = 2 5 7 10 12 15

10 years ago | 0

| accepted

Answered
How to get DIMENSIONS of ROI using roipoly??
In your other very similar question which you seem to have abandoned you said you get a binary mask out from roipoly. You can...

10 years ago | 0

Answered
How to call a file without extension?
[pathstr,name,ext] = fileparts(filename); breaks up a filename into component parts, including the name and the extension. ...

10 years ago | 0

| accepted

Answered
How to find pixel location using ROIPOLY???
The [BW, xi, yi] = roipoly(...) syntax for calling roipoly gives you the vertices of the polygon/roi in xi and yi. Are ...

10 years ago | 0

Answered
a GUI keeps popping out after close command
'figure2' is not defined in that scope. I assume you want to use handles.figure2 as the handle of your GUI to close.

10 years ago | 0

| accepted

Answered
Save each image loaded by a loop
TargetImgs{k} = imread(filename); will put them in a cell array. If all your images are the same size and you intend to do...

10 years ago | 0

Answered
Problem adding components of a vector using a while loop
You should be using b = b + x(k) rather than b = b + k(x) x is your vector, k is the index into it.

10 years ago | 0

| accepted

Answered
Is it possible to transfer a license from an old computer to a new one?
You should be able to, but it depends if your license is node-locked or user-locked. It is best to contact mathworks directly t...

10 years ago | 0

| accepted

Answered
How to know which push button clicked, to link it with the data retrieval?
Each pushbutton has its own callback by default so you already know which one was pressed. Obviously if you want to do effect...

10 years ago | 0

| accepted

Load more