Answered
Gett black screen when hovering over a variable while debugging
If it occurs when you hover over a variable whos contents extend beyond the length of the screen then yes, this is a bug in Matl...

11 years ago | 2

| accepted

Answered
How to use message box?
doc msgbox has numerous examples. It is very simple to use, but if you have any questions after looking at that page then ...

11 years ago | 0

Answered
Sending values to a matrix from if-elseif-else loop?
y = zeros( size( x ) ); y( theta <= B_1 ) = 3 .* x; y( theta > B_1 && theta <= B_2 ) = 4 .* sin( x ) ... plo...

11 years ago | 1

| accepted

Answered
Why gmdistribution.fit gives me different values?
From the help page (for fitgmdist in R2014b which has replaced gmdistribution.fit): You can fit a GMM with defined initial va...

11 years ago | 1

Answered
gui matrix getSelected index
Use the CellSelectionCallback to define a callback which will store the currently selected cell. As far as I know you cannot ge...

11 years ago | 0

| accepted

Answered
How can I use same color range on subimages?
Ok, now that I have looked at the help page for subimage as I have never used it, it works by converting your image to true colo...

11 years ago | 0

Answered
Do FEX users look at Example files?
I rarely use the FEX, but when I do I only do so for something that is easy and intuitive to understand, otherwise I won't waste...

11 years ago | 0

Answered
automatic headlining of uicontrol
You can put an edit box in a panel which can have a title if you prefer. It isn't especially any neater, but it is an alternati...

11 years ago | 0

Answered
how can I take a global variable declared in a program, take it in a function, change its value inside the fuction and give it again to the program as global?
You don't need to pass global variables anywhere. You just keep putting global myVariable within any scope in which y...

11 years ago | 0

| accepted

Answered
find size uniformity in matlab along a cell array
dim = size( A{1} ); allDimsSame = all( cellfun( @(x) isequal( size(x), dim ), A ) ); will give you the correct answer, b...

11 years ago | 1

Answered
How can I read global variables?
To use a global variable in a function you have to call global answer; within that function if the global variable was c...

11 years ago | 1

Answered
uiparent in Matlab 2013b
Matlab functions usually have numerous allowed calling syntaxes. In some cases if you use 'Name', 'Value' pairs for _any_ of th...

11 years ago | 0

Answered
How to read data from a Cell?
otherVariable = Tx5{2}; will put a 1x1118 size double vector into 'otherVariable' if that is what you want (even if it isn'...

11 years ago | 0

Answered
Toolbar Guide GUI Editor - Tool Creation - Brush
function togglebutton1_Callback(hObject, eventdata, handles) if hObject.Value == 1 brush( handles.figure1, 'on' ); ...

11 years ago | 1

| accepted

Answered
Problem with pop-up menu in gui
Popup menus disappear when you delete elements if the 'Value' is set to be larger than the number of elements in the list - e.g....

11 years ago | 0

| accepted

Answered
Matrix Indexing Being Slow
Try using containers.Map. You can set your values like 0.5 as keys and then use them to directly index into the map to retrie...

11 years ago | 0

Answered
Problem with indices (Subscript indices must either be real positive integers or logicals)
You seem to be naming a variable *scatter*. This will hide the function called *scatter* and mean that when you call sca...

11 years ago | 0

| accepted

Answered
script doesn't run from gui
You should call the script my its name without '.m' attached i.e. just v1s not v1s.m The script will run in the ...

11 years ago | 0

Answered
Slider component, unity steps
min and max can both be anything numeric provided min is less than max. I would advise setting both in the same statement (and ...

11 years ago | 0

| accepted

Answered
Opening a sequence of text file
C = [0001.hk 0002.hk] is not valid syntax. Do you mean you have a cell array with 2 cells? i.e. C = {'0001.hk' '0002....

11 years ago | 0

| accepted

Answered
Why are my functions intefering with each other?
Are you creating a new figure for the linear regression model? If not then by default it will plot on the current figure which ...

11 years ago | 0

Answered
Save the output of a pushed button
fCallback = @(src,evt) disp( src.String ); figure; hButton1 = uicontrol( 'Units', 'normalized', 'Position', [0.1 0.1 0....

11 years ago | 0

| accepted

Answered
q(:,:,3) what does mean in matrix
Take only the 3rd element for each row and column in the 3rd dimension of the matrix rather than all elements.

11 years ago | 1

Answered
Problem with axes in 4 axis plot
You should pass the axes to the scatter function explcitly rather than just having it plot on the current axes. e.g scatter...

11 years ago | 0

Answered
multiple function in one .m file
You cannot define more than one function in a file to have external access. A function visible from the command line must share...

11 years ago | 8

| accepted

Answered
Ho w to find the first minimum element in a row
pks = findpeaks( -y ); will work if you have the Signal Processing Toolbox. If you don't you can find peak finding algor...

11 years ago | 1

Answered
clustering of 1d data
data = [1, 1, 2, 3, 10, 11, 13, 67, 71]' idx = kmeans( data, 3 ); seems to give the correct clustering if you then a...

11 years ago | 0

Answered
How can I plot a conditional function?
BH3( t <= 3.07 ) = BH2; blendIndices = 3.07 < t && t <= 7.92; BH3( blendIndices ) = 0.67 * BH2( blendIndices ) + 0.3...

11 years ago | 0

Answered
How can I retrieve data from an histogram?
hHist = histfit( rand(100,1), 3, 'normal' ) hHist(1).YData will give you the numbers if you extract the values from ...

11 years ago | 3

| accepted

Answered
Standard deviation of all matrix elements (single value)
std( X(:) ) should give you the standard deviation of all elements in a matrix, X, of any shape. This is also generally...

11 years ago | 4

Load more