Answered
kmeans works with some values of k and not works with other
Surely in a binary matrix it wouldn't make any sense to have more than 2 clusters? You have a cluster of 0s and a cluster of 1s...

11 years ago | 0

Answered
Change x-axis with uicontrol slider
To answer your last post which should have been a comment rather than an answer: hax = plot(x,y) returns a handle to the l...

11 years ago | 1

| accepted

Answered
hello guys,i have matlab version r2013a , i have a project image compression,and i am encountered a problem,its the "zigzag function",its not exist in this version or what? please any help for me,for use this function
I have no idea what zigzag is. It doesn't sound like a Matlab function and it certainly isn't in my version. By the way, blk...

11 years ago | 0

Answered
function within a gui set function
You can manipulate the string and apply that, but I would favour bundling your text box handles together into an array of handle...

11 years ago | 0

| accepted

Answered
Can I nest an if statement in a for loop?
Yes, you can put an if statement inside a for loop. Your syntax for the for loop is invalid though, not the if statement even...

11 years ago | 0

| accepted

Answered
how to image entirely a 3D file?
There are methods using e.g. doc surf doc slice http://uk.mathworks.com/help/matlab/visualize/overview-of-volume-visu...

11 years ago | 0

| accepted

Answered
MATLAB error with indexing
Well, that is exactly what it does - it yields an error! Unlike C++ or Java or other languages you cannot chain together (or ...

11 years ago | 0

Answered
performing fourier transform an plotting magnitude and phase spectrum
doc fft doc Fourier Analysis

11 years ago | 0

Answered
Error with Guide opening
It's complaining precisely because you don't have a create function. If you go to the Property Inspector you will probably fi...

11 years ago | 0

| accepted

Answered
function having plot command
Just call figure ahead of each call. Personally I always specify the exact axes I want to plot on in a plot instructi...

11 years ago | 0

| accepted

Answered
How can I connect buttons in GUI?
You need to attach your variables to the 'handles' structure in each callback. So, in one callback: handles.x = 3; hand...

11 years ago | 0

| accepted

Answered
Throwing MException subclass from MEX file
You could use mexErrMsgIdAndTxt( "MyProg:Id", "Somoething went wrong."); in the mex. Then in a wrapper function...

11 years ago | 0

Answered
Speeding Up Logical Operations
What does the profiler say about the speed of this? Is it the function that is slow or the number of times you call it? Wi...

11 years ago | 0

Answered
Do my Toolboxes work?
First you need to check if this class exists in your version. I suspect it does not since R2010a is quite old and class-based i...

11 years ago | 0

Answered
Use of pointers to structures
Matlab does not have the concept of pointers. You can use a class derived from handle to achieve this 'by reference' behaviou...

11 years ago | 0

Answered
round off to nearest 5 instead of 10
round( x / 5 ) * 5;

11 years ago | 10

| accepted

Answered
Save image name as input from user
imagename = [answer '.tif'] if you just want to append .tif. Personally I would use uiputfile though rather than write m...

11 years ago | 0

Answered
What is the right OO implementation?
If you are going to write get and set function anyway then there is absolutely no point in making properties private. Just use ...

11 years ago | 1

Answered
problem in while loop?
You should be using b(:,j) = V(:,j) not n in your loop, which also should probably be a for loop, but that's a side issu...

11 years ago | 0

| accepted

Answered
what is the handle for my uipanel, GUIDE
handles.panel1 I would imagine since it doesn't look like you changed its tag. I don't know anything about that waitbar su...

11 years ago | 0

Answered
How to create a new m file automatically with filled in commands every time?
What is the a=[x '.m'] type a delete x.m line of code trying to achieve? I do something similar to this to create a t...

11 years ago | 1

Answered
Scattering in a loop.
You get hundreds of figures because you are using the figure; instruction which will create a new figure for you every t...

11 years ago | 0

Answered
Adding a push button to a figure without using GUIDE
You have to specify the Units before the Position else default units of characters are used, meaning your push button will be mi...

11 years ago | 1

| accepted

Answered
How to plot multiple plots in a loop ?
for i = 1:3 figure(2*i - 1); plot( something ); figure(2*i); plot( somethingElse ); end

11 years ago | 2

| accepted

Answered
Ensuring same bins in image histogram
[counts,x] = imhist(___) should do the job so far as I can see. Of course your data with a range of 12000 will be spread o...

11 years ago | 0

Answered
How to save entire workspace?
Workspaces of functions? In the vast majority of cases only 1 function is ever running (and thus has a workspace) at any give...

11 years ago | 0

| accepted

Answered
Why use this syntax?
Personally I find it good practice to do the above, especially if the same thing is being used more than once. This is especial...

11 years ago | 0

| accepted

Answered
Error: Index exceeds matrix dimensions?
Before you do anything else and before I would even consider whether there are other problems in the code, you cannot name a var...

11 years ago | 2

| accepted

Answered
Modify a running script, will it affect the running process?
Your running script should be unaffected by a change I think. I just did a very simple test though so I can't guarantee for any...

11 years ago | 0

| accepted

Answered
Get value from a struct
Change the function and instead of returning the structure pull the field you want out of the structure within your function and...

11 years ago | 0

| accepted

Load more