Beantwortet
Call a function in an m-file from a method of a handle class
If you don't pass the object in then it has to be a static function and has knowledge of the class only, not the specific object...

etwa 9 Jahre vor | 0

Beantwortet
Cross-Talk between handle Class Objects?
This depends entirely on what your setValue and getValue functions do, but taking a flying guess... If you declare a property...

etwa 9 Jahre vor | 0

| akzeptiert

Beantwortet
Property validation in subclass
In general I do this kind of thing via delegation from the superclass set function. Your property declaration confuses me thoug...

etwa 9 Jahre vor | 2

Beantwortet
functions 'hist(x)' or 'histogram(x)' ?
Which help did you look in? You should always use the help for the version you have, easiest to access via e.g. doc hist ...

etwa 9 Jahre vor | 0

| akzeptiert

Beantwortet
How do i add a title on an imshow graph?
doc title It's as easy as that really, but as I always advise people it is better if you use explicit axes handles for thin...

etwa 9 Jahre vor | 2

| akzeptiert

Beantwortet
FUNCTION (INPUTS) Problem: I am unable to use a vector of inputs of a function as a substitute of listing the inputs each by each
I don't know anything about fmincon as I have never used it, but I assume it works like any other function that takes a function...

etwa 9 Jahre vor | 0

| akzeptiert

Beantwortet
How to find peaks along a dimension in a 3d matrix
doc squeeze

etwa 9 Jahre vor | 0

| akzeptiert

Beantwortet
Index exceeds matrix dimensions
You are indexing into an array of 240 elements in the first case, 300 elements in the second case. You haven't told us what i...

etwa 9 Jahre vor | 0

| akzeptiert

Beantwortet
Adding values in an array within limits
B = zeros( size( A ) ); validIdx = cumsum( A ) <= 9; B( validIdx ) = A( validIdx ); B( nnz( validIdx ) + 1 ) = 9 ...

etwa 9 Jahre vor | 1

| akzeptiert

Beantwortet
Q. How to get the iteration number at which the problem has been converged?
Just add in an if bestExpectedProfit == 100 break end and then it will be the iteration you want after the loop...

etwa 9 Jahre vor | 0

Beantwortet
when i used im2bw function in gui it is displayed as red and blue insted of black and white.Why is it so?
imagesc applies a colourmap, as explained in doc imagesc You can use imshow or you can set the colourmap to greyscale or j...

etwa 9 Jahre vor | 0

Beantwortet
Reverse y axis order
set( hAxes, 'YDir', 'reverse' ) should do this for an axes hAxes.

etwa 9 Jahre vor | 0

| akzeptiert

Beantwortet
How to set value of EditText to double variable in matlab
str2double( get(handles.EditText , 'String') )

etwa 9 Jahre vor | 0

Beantwortet
make while loop into vector so I can save as .mat file
Replace fprintf('January %d\n',i); with result{i} = sprintf('January %d\n',i); and the same for all the others,...

etwa 9 Jahre vor | 1

| akzeptiert

Beantwortet
Plot Error: Vectors should be the same length
You seem to keep reusing 'x'. I see 3 different places where it is redefined. The final one seems to make it a vector of lengt...

etwa 9 Jahre vor | 0

Beantwortet
GUI issues -> 1) memory: assignin, getappdata/setappdata and handles 2) best programming practices
vals = getappdata(obj); returns all data stored with a given graphics object. Personally I attach things to the handles ...

etwa 9 Jahre vor | 0

Beantwortet
How to Make All Children of a Figure Invisible?
You could store them all in an array and then you can just use set( hGraphics, 'Visible', 'off' ) Certainly your axes wo...

etwa 9 Jahre vor | 1

| akzeptiert

Beantwortet
Different class definitions for value classes and a handle classes?
classdef MyClass < handle is the obvious difference, but also your methods which make changes to the object of the class mu...

etwa 9 Jahre vor | 0

| akzeptiert

Beantwortet
In a contour plot, manipulate colors of contours
That's a few questions in one, but I'll try to answer them all even if some are less satisfactory than others. The colour of ...

etwa 9 Jahre vor | 0

Beantwortet
Can I associate one vector with another one?
There is no automatic way of doing this, you would have to apply to same swap indices yourself. If you merge them into a sing...

etwa 9 Jahre vor | 0

Beantwortet
How can I put data into a Cell
for n = 1:numNames Name{n} = getYourNameFromSomewhere( n ); end Doing it in a loop implies your names are somewher...

etwa 9 Jahre vor | 0

Beantwortet
GUI Call back Function Error!
What version of Matlab are you using? I'm guessing you are not in the latest and your main file is a script which does not al...

etwa 9 Jahre vor | 0

| akzeptiert

Beantwortet
why this message( Not enough input arguments.)
At a wild guess you are just clicking the big green 'Run' button to run your code. Your function takes an argument though so ...

etwa 9 Jahre vor | 1

Beantwortet
Error Using GUI after first time - "Error using handle.handle/set Invalid or deleted object."
This line: handles.nfiles=nfiles; will overwrite what I assume started off as a uicontrol the first time you run the cod...

etwa 9 Jahre vor | 0

| akzeptiert

Beantwortet
How to use multiple equal signs?
a == b && b == c

etwa 9 Jahre vor | 2

Beantwortet
Upgrade from Matlab 2015b to 2017a
No

etwa 9 Jahre vor | 1

Beantwortet
Usage of validateattributes with 'nonzero'
Which version of Matlab are you using? In R2017b: >> validateattributes( [0 0 1], { 'numeric' }, { 'nonzero' } ) Expect...

etwa 9 Jahre vor | 0

Beantwortet
Error while Debugging the code as : InvalidPropertyThere is no SelectionChangeFcn property on the TabGroup class.
A look at the documentation together with the error message should make this obvious though I have also had a blind spot at time...

etwa 9 Jahre vor | 0

| akzeptiert

Beantwortet
Changeing the x Values when you plot the values
plot( n, s ); as shown clearly in doc plot except that 100:10:500 is 41 values rather than 40.

etwa 9 Jahre vor | 1

| akzeptiert

Mehr laden