matlab

MATLAB Saving multiple figures to a PDF

馋奶兔 提交于 2021-02-18 22:52:06
问题 Is there any way to do this? I know how to use saveas ( saveas(1, filename, 'pdf'); ) to save one figure to a PDF file, but is it possible to add multiples? So something like ( saveas(1,2,3) filename, 'pdf')); . Thanks 回答1: I don't think so - you need to increment the file name in some manner. I would use something like: for ii=1:3 saveas(ii,[filename '-' num2str(ii)],'pdf) end As a side note, I have had repeated difficulties when including the pdfs generated by matlab in a manuscript

plotting normal vector in 3d

≡放荡痞女 提交于 2021-02-18 17:05:51
问题 I have a normal vector that I calculated from the cross product of two vectors [xn,yn,zn] and I have a point[x0,y0,z0] how can I plot the normal in 3d. I didn't know how to do it. Any suggestions please? 回答1: With Arrow heads: a = [2 3 5]; % your point [x0,y0,z0] b = [1 1 0]; % your normal vector c = a+b; % end position of normal vector %quiver3 syntax: quiver3(x,y,z,u,v,w) quiver3(a(1), a(2), a(3), c(1), c(2), c(3)); axis equal; This will hopefully draw a vector from your point into the

plotting normal vector in 3d

此生再无相见时 提交于 2021-02-18 17:04:25
问题 I have a normal vector that I calculated from the cross product of two vectors [xn,yn,zn] and I have a point[x0,y0,z0] how can I plot the normal in 3d. I didn't know how to do it. Any suggestions please? 回答1: With Arrow heads: a = [2 3 5]; % your point [x0,y0,z0] b = [1 1 0]; % your normal vector c = a+b; % end position of normal vector %quiver3 syntax: quiver3(x,y,z,u,v,w) quiver3(a(1), a(2), a(3), c(1), c(2), c(3)); axis equal; This will hopefully draw a vector from your point into the

Eigen linear algebra solvers seem slow

血红的双手。 提交于 2021-02-18 12:17:26
问题 I want to solve a linear algebraic equation Ax = b using Eigen solvers. In my case, A is a complex sparse matrix(26410*26410), b is a real vector (26410*1). I use mex file in MATLAB to map the sparse matrix A and vector b to Eigen accepted format. The reason why I use Eigen solver is to hope it would be faster than solving directly in MATLAB using x = A\b . However, after tried LDLT, SparseLU, CG and BiCGSTAB, I found the results are not very satisfying: LDLT takes 1.462s with norm(A*x - b)

How do I add a new toolbox to my already installed Matlab version?

こ雲淡風輕ζ 提交于 2021-02-18 12:16:12
问题 I need to add a toolbox to my Matlab Student version. I know that I have to download the toolbox files, place them in some directory and then specify a path. However, I am not quite sure about where I have to place my files. I downloaded two zip archives: 'Symbolic Math Toolbox (Common) 5.10' and 'Symbolic Math Toolbox 5.10'. Where do I have to place them on Mac OSX Mountain Lion? How and where do I specifiy the path? Thank you all, this will help me a lot with my project! 回答1: Ok, I figured

How do I add a new toolbox to my already installed Matlab version?

自闭症网瘾萝莉.ら 提交于 2021-02-18 12:15:49
问题 I need to add a toolbox to my Matlab Student version. I know that I have to download the toolbox files, place them in some directory and then specify a path. However, I am not quite sure about where I have to place my files. I downloaded two zip archives: 'Symbolic Math Toolbox (Common) 5.10' and 'Symbolic Math Toolbox 5.10'. Where do I have to place them on Mac OSX Mountain Lion? How and where do I specifiy the path? Thank you all, this will help me a lot with my project! 回答1: Ok, I figured

Bring axes to front without redrawing the figure?

不羁岁月 提交于 2021-02-18 12:10:45
问题 Is there a way in Matlab to bring an axes to front without having Matlab perform a redraw ( drawnow ) implicitly? Background to my question: I am preparing a large figure with several subplots. In some of them I have 2 axes superposed, because I want to see the same data on 2 different y-scales. After playing around with axes settings, I finally got the figure to look like I expected. But: I need to bring one of the axes to front (in my case, the left axes hAxL). So I have this line in my

Matlab: Is it possible to numerically solve a system of ode's with a mixture of initial and terminal conditions?

陌路散爱 提交于 2021-02-18 11:26:29
问题 I'm trying to use ode45 to solve a system of ODE's: [X,Y]= ode45(@sys,[0, T],y0); where, function dy = sys(t,y) dy(1) = f_1(y) dy(2) = f_2(y) dy(3) = f_3(y) end The problem is that the function ode45 requires that y0 be initial values [y_1(0), y_2(0), y_3(0)] , while in my system, I only have the values [y_2(0), y_3(0), y_3(T)] available. Mathematically, this set of initial/terminal conditions should be enough to pin down the system, but is there any way I can work with that by ode45 or any

Optimizing (minimizing) the number of lines in file: an optimization problem in line with permutations and agenda scheduling

旧巷老猫 提交于 2021-02-18 09:55:12
问题 I have a calendar, typically a csv file containing a number of lines. Each line corresponds to an individual and is a sequence of consecutive values '0' and '1' where '0' refers to an empty time slot and '1' to an occupied slot. There cannot be two separated sequences in a line ( e.g. two sequences of '1' separated by a '0' such as '1,1,1,0,1,1,1,1'). The problem is to minimize the number of lines by combining the individuals and resolving the collisions between time slots. Note the time

Matlab Stereo Camera Calibration Scene Reconstruction Error

大兔子大兔子 提交于 2021-02-18 07:44:27
问题 I am trying to use the Computer Vision System Toolbox to calibrate the pair of cameras below in order to be able to generate a 3-D point cloud of a vehicle at a range between 1 to 5m. The output image size was approximately 1 MB per image for the checkerboard calibration images and the checkerboard square size was 25 mm. The cameras used were a pair of SJ4000 HD1080P cameras. The cameras were placed as parallel to each other as possible with no angle in the vertical axis. The checkboard