Answered
Looping for find peak of signal
why can't you just use |max| or |findpeaks|? *More per comments* %data 1 valley, two peaks x = rand(1,100)*10; x(20) = -3; x...

15 years ago | 0

Answered
Declaration of Variables
No. It does not. If the input is a string you could convert it to a number and check and see e.g. x = '3'; is_x_a_numb...

15 years ago | 0

Answered
Read vectors into a matrix of NaNs??
repmat({nan},blah) will replicate a cell of nan. You don't want cells ( |doc cell|, for more info). You want a regular matr...

15 years ago | 0

| accepted

Answered
"find" function - precision problem?
no, it's still the full double precision, you're just not seeing it; show the full thing using format long. format long Time...

15 years ago | 0

Answered
what is the difference between conv2, filter2 and imfilter..?
TMW recommends |imfilter| if you have the IPT and are working with images. Personally, I only use |conv2| since I hate the conv...

15 years ago | 0

Answered
log2(0)=-inf problem
Write your own log2 and call it: function out = mylog2(in) out = log2(in); out(~in) = 0; end Add the F/E output opti...

15 years ago | 1

Answered
how to stop in Gui
Sounds like you want to use a timer: doc timer

15 years ago | 0

Answered
Dynamically plot graphs
I would recommend using |subplot|.

15 years ago | 0

Answered
RK4 in MatLab Help!
So is this script also called vexact? Also, when youc all |feval|, which is unnecessary and could be rewritten as vexact(t,...

15 years ago | 0

Answered
Extract windows from signals
No need for loops: v = 1:40; %sample vector wl = 3; %window length idx = [3 7 21]'; %start indexes v2 = v(bsxfun(@plus,idx...

15 years ago | 1

| accepted

Answered
Integer check
floor(x)==x

15 years ago | 15

| accepted

Answered
find values between constants in vector
idx = X >= a & X <= b; where X is your vector, a is the lower bound, b is the upper bound. This will be their logical va...

15 years ago | 1

| accepted

Answered
How to change mouse arrow to hour-glass for a GUI created by GUIDE?
Put the: set(gcf,'pointer','watch') at the bottom of the automatically generated OpeningFcn, e.g.: function examp...

15 years ago | 0

Answered
How can I save a list of open m-files?
See this question and answers from last week: <http://www.mathworks.com/matlabcentral/answers/15859-can-i-save-preserve-list-of...

15 years ago | 0

Answered
4D regression
Is it a polynomial you're looking for? If so - write out the equations and then put them in matrix form and solve them using ax...

15 years ago | 0

Answered
smooth3
Well from opening |smooth3| open smooth3 and taking a quick look at the code, it looks like the kernel for a box is: ...

15 years ago | 1

Answered
how to draw a plane?
You could also use a |surf| or a |slice|

15 years ago | 0

Answered
Create matrix by adding elements of two vectors?
In reply to the |bsxfun| clarification comments: Think that you are bsxfun. The goal is to apply some function of one of the i...

15 years ago | 0

Answered
How do I delete an entire row if a specific column contains a zero?
X = X(logical(X(:,2)),:); straight conversion to logical will be faster. It is advised to avoid using find and to use logi...

15 years ago | 5

Answered
Print curly braces in a plot
I would recommend starting by reading the tutorial in: doc MATLAB>User Guide>Graphics>Annotating Graphs>Adding Text Anno...

15 years ago | 0

Answered
renaming large variables programmatically
You could try doing it in chunks though there's no guarantee that'll be faster. You could also convert to single precision if n...

15 years ago | 0

Answered
&& trouble !
_delta_ is apparently an array with more than one element so in the second part of the conditional |delta>pi| will also be non-s...

15 years ago | 0

| accepted

Answered
Matrix with alternating signs in each row vector
b = bsxfun(@plus,k',a(:,1:N)) to your comment in the Fangjun's answer.

15 years ago | 1

Answered
Using imwrite without screen capturing
look at |saveas| doc saveas

15 years ago | 1

| accepted

Answered
Can I save / preserve list of scripts open in the editor?
Sure: make a new script that calls: edit script1 edit script2 edit script3 %etc. it'll open all of 'em. You might also wa...

15 years ago | 0

Answered
dir problems
It means inside the function you defined a variable as _dir_. dbstop if error Now run your function, it'll blow up ...

15 years ago | 1

Answered
Contourslice error
[r,theta,zg]=meshgrid(r,theta,zg); xg=r.*cos(theta); yg=r.*sin(theta); When you multiply xg,yg by the sine and cosine of the...

15 years ago | 0

| accepted

Answered
end of line
in |textscan| there is an _end of line_ setting that gives you options: doc textscan

15 years ago | 1

Answered
Hough Transform - Detecting angled lines
I would look at the _eccentricity_ option in |regionprops| doc regionprops

15 years ago | 0

Answered
how to expang an image
Look at the _'InitialMagnification'_ option in both |imshow| and |imtool|

15 years ago | 0

Load more