Answered
why is the answer 0.8058 ?
It's a vector because you specified that it must be. Let's start off by simplifying things: D(DD) is D(1:6). Since D has six e...

5 years ago | 0

Answered
Open the .dat file in Matlab
I've never even heard of PhysioNet. It took me 15 min to do a web search and figure it out. Just sayin. There's a basic overv...

5 years ago | 1

Answered
error in disp line
First off, use the formatting tools available to you to post the actual code. Do not post pictures of code. Nobody can run a p...

5 years ago | 0

Answered
error too many input arguments
Only looking at that line, did you perhaps mean to do this? plot(imag(xx0(kk)),'r.')

5 years ago | 0

Answered
Label drag and drop on plot not working the same between MATLAB versions
Ah. Figured it out. Set the pickableparts property of the labels. te = text(xe,ye,['_{End}'],'rotation',45,'parent',ax,...

5 years ago | 1

| accepted

Answered
make slices and project to 2d plot
The general idea would be to use contour() contour(X,Y,Z,V) will draw the contour at each level specified by the vector V. I...

5 years ago | 0

Answered
Store values from while loop into an array
You're testing that n<=length(u), but then you immediately increment it. You'd need to adjust your test limit. Better yet, a...

5 years ago | 0

Answered
Remove elements within a range from an array
I'm going to assume that near-duplicate columns happen neatly and that only complete near-duplicate columns count A = [1 1.2 3 ...

5 years ago | 0

| accepted

Answered
converts the darkest 15% pixels of the original image
I know that this is homework, but I'm inexplicably inclined to solve it anyway. The way to approach the "percentage of pixels" ...

5 years ago | 1

| accepted

Answered
Subtraction of arrays with different sizes
Perhaps something like this is what you're looking for? A = randn(10000,2); B = randn(1000,2); C = bsxfun(@minus,permute(A,[1...

5 years ago | 1

| accepted

Answered
Using for loop to plot multiple plots on the same graph
I'm going to guess the primary issue is with your function not getting access to the changing parameter, but let's just show tha...

5 years ago | 1

| accepted

Answered
Errors using fzero in rootfinding
Your problem is with how you set up your function. Your parameter M is a vector in the function definition, so at any given poi...

5 years ago | 0

Answered
Calculate mean of gray Value
Something like this: % mean of non-black regions mean(mypicture(mypicture>0)) This assumes that the image background is actua...

5 years ago | 1

| accepted

Answered
imhist function is not generating
imhist() expects its inputs to be single-channel images. You could either take the histogram of some overall brightness metric:...

5 years ago | 0

Answered
Cumulatively sum numbers in an array between two indices
Something like this: x=5:5:50 sum(x(4:8))

5 years ago | 0

| accepted

Answered
Cross product of two vectors not perpendicular to the input vectors
Ah, yeah. Beware using equality tests when you're dealing with floating point math. The result from dot(C,v1) isn't zero; it's...

5 years ago | 1

| accepted

Answered
How do I compare two imags to see how many pixels it has shifted?
I'm almost certain that there's a smarter and more elegant way to do this than what I'm doing, but this was my naive approach. ...

5 years ago | 0

Answered
How to write a function that finds the connected neighbors of a pixel
I'm not sure I understand the question correctly, but I'm going to assume that you don't want the whole connected group and that...

5 years ago | 0

Answered
Compare dates between a matrix and a given range and read the values
This is not a real answer, but my preference for very large files. I occasionally have to deal with csv files that are several ...

5 years ago | 0

Answered
Plotting graph from the values of a 15x3 matrix
Something like this: PTC=[1 30 3.4; 1 40 3.5; 1 50 3.6; 2 30 3.41; 2 40 3.51; 2 50 3.61; 3 30 3.42; 3 40 3.52; ...

5 years ago | 0

Answered
checkerboard matrix (Problem Nr 4 from Cody)
I can see what you're going for, but you've got a couple issues. The reason that you're not getting any pattern out is that t...

5 years ago | 0

| accepted

Question


Can variable renaming tooltip be disabled?
I know that the variable/function renaming behavior can be disabled entirely. That's not my goal. I use the feature all the ti...

5 years ago | 1 answer | 0

1

answer

Answered
Not enough input arguments(if isinteger(x))
Is var expected to be a variable? If so, then it's not defined. It's helpful to avoid naming variables in a way that overloads...

5 years ago | 1

| accepted

Answered
sort matrix by absolute value
Consider the case for a vector: A=randi(19,[10 1])-10 [~,idx]=sort(abs(A)) Asorted=A(idx) For other arrays, you'll have to...

5 years ago | 2

| accepted

Answered
Problem with a function: to convert from base3 to base10
For the future, please use the formatting tools available to you to paste formatted code. Don't post pictures of code. Nobody ...

5 years ago | 0

Answered
How to create a graph of this equation?
x=linspace(-0.1,0,100); y=0.004*(-2500*x + 25*exp(-100*x)); plot(x,y)

5 years ago | 0

Answered
Error using * Incorrect dimensions for matrix multiplication
c1,c3,s1,s3 are vectors. If you want elementwise multiplication, use that. s23 = -((a3+a2*c3)*Pz) + (c1*Px+s1*Py).*(a2*(s3-d...

5 years ago | 0

| accepted

Answered
Change brightness in images
Long story short, I don't know where your problem is, unless it's part of the missing code or the aforementioned questions. I...

5 years ago | 0

| accepted

Answered
How to record each iteration in a For loop and put them into a single matrix?
If you know the size of the things that you need to store in an array, and the size doesn't change, the general idea is somethin...

5 years ago | 0

Answered
segmentation using the color thresholder in YCbCr color space
If I get your question correctly, you already have a means of generating a mask; you're asking how to apply the mask. Conside...

5 years ago | 0

| accepted

Load more