How do yo draw a circle in a matrix with the value at 10V?? This is my set code so far, the circle should be to the left of the rectangle.
a=zeros(20,35);
a(:,1)=-5;
a(:,34)=5;
for kk=1:1000;
for ii=2:19;
for jj=2:34;
a(ii,jj)=1/4*(a(ii-1,jj)+a(ii+1,jj)+a(ii,jj-1)+a(ii,jj+1));
a(4:15,13:15)=-10;
end
end
end;
pcolor(a)
shading interp
|
|
0
|
|
|
|
Reply
|
Jay
|
12/5/2010 11:20:08 PM |
|
What do you mean by at the value 10?
First of all, you go through a useless loop over kk that just makes it
take 1000 times longer than it should.
Secondly, the values of a range from -10 to +5. They never equal 10.
Repeat - they never ever equal +10.
Thirdly, you have the line
a(4:15,13:15)=-10;
nested way deep in the loop when it does not even need to be in the
loop AT ALL, since it doesn't depend on the loop variables.
And again, even if the value 10 *did* occur somewhere in your matrix
(say it's a rectangle or maybe some scattered elements around the
matrix), what does it mean to put a circle at the location with a
value of 10? Do you want a circle of some (unspecified) radius
centered over every single pixel that has a radius of 10, so that if
you had 100 pixels with value 10, you'd have 100 circles?
Please take more time in accurately describing what you need.
|
|
0
|
|
|
|
Reply
|
ImageAnalyst
|
12/5/2010 11:56:05 PM
|
|
I simply what to draw a circle in the set matrix, they are at a value since they represent an electromagnetic field , thanks
|
|
0
|
|
|
|
Reply
|
Thomas
|
12/6/2010 12:14:05 AM
|
|
On Dec 5, 7:14=A0pm, "Thomas " <bj...@yahoo.com> wrote:
> I simply what to draw a circle in the set matrix, they are at a value sin=
ce they represent an electromagnetic field , thanks
---------------------------------------------------------------------------=
-----
Thomas:
Like the first poster, Jay, you are not being specific enough.
(1) Where in the matrix? What is the center and what is the radius?
(2) I still don't know what you mean by "they are at a value".
Obviously elements in a matrix have values, but what does "they are at
a value" have to do with drawing a circle?
(3) Do you want a solid circle - a disc - or just the perimeter.
(4) Do you want the circle to appear in an overlay over your image, or
do you want the circle to actually be written into the pixel values
themselves, thus changing their original values?
(5) If you want the circle written into the image, what value would
you like the circle to have?
(6) If you want the circle to just appear in the overlay what color do
you want it to have?
(7) Have you searched the newsgroup? Circle drawing comes up very
frequently.
(8) Have you looked at the rectangle function to draw a circle?
Please answer each question by number.
Why am I spending more time probing you about what you want to do than
you are explaining it? Again I'll say "Please take more time in
accurately describing what you need. " I'll give you two guys one
more shot at it before I bail out.
|
|
0
|
|
|
|
Reply
|
ImageAnalyst
|
12/6/2010 12:48:26 AM
|
|
|
3 Replies
727 Views
(page loaded in 0.062 seconds)
Similiar Articles: Draw Circle in matrix - comp.soft-sys.matlabHow do yo draw a circle in a matrix with the value at 10V?? This is my set code so far, the circle should be to the left of the rectangle. a=zeros(... draw circle, eclipse and various shape on image matrix - comp.soft ...Hi, I wonder if there is some files available in matlab central that can draw circle, eclipse and various shape on an image matrix? Note: not on a pl... Drawing a circle. - comp.graphics.api.openglDraw Circle in matrix - comp.soft-sys.matlab How do yo draw a circle in a matrix with the value at 10V?? This is my set code so far, the circle should be to the left of ... draw rectangles - comp.soft-sys.matlabDraw Circle in matrix - comp.soft-sys.matlab How do yo draw a circle in a matrix with the value at 10V?? This is my set code so far, the circle should be to the left of ... plotting smooth cirle (cirlcular arc) - comp.soft-sys.matlab ...Draw Circle in matrix - comp.soft-sys.matlab plotting smooth cirle (cirlcular arc) - comp.soft-sys.matlab ... Uniform random rotation matrix - comp.soft ... plotting ... plotting circles in matlab - comp.soft-sys.matlabdraw circle, eclipse and various shape on image matrix - comp.soft ... Hi, I wonder if there is some files available in matlab central that can draw circle, eclipse and ... drawing NURBS curves on a 2D Image - comp.graphics.api.opengl ...draw circle, eclipse and various shape on image matrix - comp.soft ... Draw Circle in matrix - comp.soft-sys.matlab drawing NURBS curves on a 2D Image - comp.graphics.api ... Generating a uniform random rotation matrix - comp.soft-sys.matlab ...Draw Circle in matrix - comp.soft-sys.matlab Uniform random rotation ... Simple question: generating and drawing ... simple question about MODEL matrix - comp.graphics ... Uniform random rotation matrix - comp.soft-sys.matlabDraw Circle in matrix - comp.soft-sys.matlab Uniform random rotation matrix - comp.soft ... plotting smooth cirle (cirlcular arc ... ... smooth curve using glMap? - comp ... overlapping circles - find the form-faktor - comp.soft-sys.matlab ...Draw Circle in matrix - comp.soft-sys.matlab overlapping circles - find the form-faktor - comp.soft-sys.matlab ... draw circle, eclipse and various shape on image matrix ... Draw a circle in a matrix / image - File Exchange - MATLAB CentralDraw a circle in a matrix / image. by Peter Bone . 19 Mar 2007 (Updated 19 Mar 2007) Draw a circle in a 2D matrix using the integer midpoint circle ... Draw circle - MATLAB - MathWorks - MATLAB and Simulink for ...pdecirc -Draw circle ... include the circle. You can export the Geometry Description matrix from pdetool by using the Export Geometry Description option from the Draw menu. 7/22/2012 10:16:38 AM
|