This question already has answers here:
How to plot a circle in Matlab?
(2 answers)
How to plot a filled circle?
(1 answer)
Closed 5 years ago.
I know I can plot a dot and select its size with the word 'markersize' like this
plot(0,0,'.','markersize',50) %Dot centered in (0,0)
The size of the dot produced does not change if we amplify the plot. It always seems to have the same size to our eye. I would like to produce dots (or circles) with a real radius, so that when the image is amplified it appears bigger. What are my options?
Use rectangle command with curvature [1 1] it will draw circles with relative radius.
Related
This question already has an answer here:
Area between line and curve (no function)
(1 answer)
Closed 6 years ago.
I want to determine the area between the red line and the blue line but only to the y-value of 4.559. How can I achieve that?
In general:
First you have to subtract the two functions from each other. After
that, you have a function that represents the delta in y for each
point on the x-axis.
After that you have to calculate the integral, for matlab you should look here Matlab - Numerical Integral
The last step is inserting the left, and the right bound of your desired area to calculate. The result is the area under the surface
Be careful when subtracting the functions, the result of the area might be negative (negate it in this case) if the "bigger" function is the subtrahend
This question already has answers here:
Cylinder with filled top and bottom in matlab
(2 answers)
Closed 7 years ago.
I am trying to create a filled 3d shape that will look similar to this: (long round object)
(no need for the round part at the top, one color for all the object is good)
I've tried to create many similar circles with different center point but it didn't work, and with cylinder all I got was weird shapes.
To make a cylinder the exact name exists as a command:
figure;
cylinder(0.1,20);
axis equal;
This question already has answers here:
I need to fit a best circle to the 3D data in matlab
(2 answers)
Closed 7 years ago.
I have my 3D data X,Y,Z (Matrices with size X = 200*1, Y = 200*1, Z = 200*1)
I want to fit the data to the best fit circle
You have 200 pts in 3d space. And a circle also in 3d space, the circle is defined by its centre (3variables), orientation (normal to the circus, so 2 more variables, since its length does not matter) and radius (one more variable), Given a circle and an abitrary point, the distance from the pt to the circle is given by one side of a triangle formed by taking a line from the point to the centre of the triangle then to the radius. This will be defined in terms of the 7 variables (centre, orientation, radius), now you have two hundred distances, sum them and this is a formula in terms of radius, orientation and position, now put this formula inside any of the matlab optimizers and you will find the optimal centre,orientation, radius. This is for sure a convex problem...
This question already has answers here:
Matching images with different orientations and scales in MATLAB
(4 answers)
Closed 7 years ago.
After bounding natural images with textboxes (green), I want to apply a homography matrix (perspective correction) to project the green area to a rectangle.
Please refer to the link for the image mentioned above
http://i.stack.imgur.com/nhe4S.jpg
How can I implement the code / call the code in
http://www.mathworks.com/matlabcentral/answers/26141-homography-matrix
Alternatively, any other possibilities of other suitable algorithms?
I can provide you with the coordinates of the bounding box, obtained with
img=imread('perspective.jpg');
imshow(img); ginput(4)
and the coordinates of the quadrangle is
ans =
23.1597 25.0459
22.0220 55.9541
164.2375 61.6427
165.3752 30.1657
You can compute the homography transformation between the two bounding boxes using the fitgeotrans function. You can then apply the resulting transformation to the image using imwarp.
This question already has answers here:
Turning y axis upside down in MATLAB
(5 answers)
Closed 9 years ago.
Example data:
I can change the values from up to down by the command
B(end:-1:1,:)
I run it and get
However, I want to change the values on the y-axis such that they go from 0 to 180.
How can you change the values on the y-axis in Matlab?
To change direction of y axis, including axis labels and plotted values, you use
set(gca,'YDir','reverse')
When you plot an image, for example using imagesc, the YDir property is automatically set to reverse. So, to change it, set it to normal:
set(gca,'YDir','normal')