tag:blogger.com,1999:blog-9101701713138538731.post1694994230241385652..comments2017-07-19T11:45:16.806-03:00Comments on How to Use Scilab: Plotting vectorsAlex Carneirohttps://plus.google.com/110184809238606749291noreply@blogger.comBlogger24125tag:blogger.com,1999:blog-9101701713138538731.post-87361524173411873562012-04-28T14:43:05.021-03:002012-04-28T14:43:05.021-03:00Hi Dima. I think any version of Scilab can export ...Hi Dima. I think any version of Scilab can export graphs to eps format.<br />It's possible to created eps files through code, but it's easier to export by clicking on 'file' option in the graph window.<br /><br />Regards.Sheephttps://www.blogger.com/profile/14503428177777397005noreply@blogger.comtag:blogger.com,1999:blog-9101701713138538731.post-31305025183825082612012-04-28T13:16:13.901-03:002012-04-28T13:16:13.901-03:00Can you export champ-plots in eps format? If ``yes...Can you export champ-plots in eps format? If ``yes'', which version of Scilab do you use?Dimahttps://www.blogger.com/profile/17868714451632205113noreply@blogger.comtag:blogger.com,1999:blog-9101701713138538731.post-37782508119362403462012-04-03T17:08:38.755-03:002012-04-03T17:08:38.755-03:00Hi VV, thanks for commenting.
champ1() function w...Hi VV, thanks for commenting.<br /><br />champ1() function works with four parameters: x, y, vx and vy.<br />The first two ones are vectors [1 x n] (or [m x 1]), and the two last ones are matrices [m x n], where x and y means the grid locations of the vectors and vx and vy means the vectors (with i and j components).<br /><br />Look the example that I posted and see the variables after running.<br /><br />Regards.Sheephttps://www.blogger.com/profile/14503428177777397005noreply@blogger.comtag:blogger.com,1999:blog-9101701713138538731.post-92019012522240607582012-04-03T16:24:49.841-03:002012-04-03T16:24:49.841-03:00Hello!
I have a question. my program returns me r...Hello!<br /><br />I have a question. my program returns me results for x and y components of position vector for each of 640 particles and vx, vy components of velocity for each of 640 particles (the problem is from fluid mechanics).<br />i have tried the following piece of code:<br />x=[-0.1720490 -0.1487229 -0.1305250 -0.1145734 -0.0985839 -0.0839435 -0.0688476 -0.0544547 -0.0397398 -0.0254066];<br />y=[-0.9771022 -0.9786739 -0.9800474 -0.9809699 -0.9819347 -0.9828030 -0.9835949 -0.9842851 -0.9848132 -0.9851994];<br />vx=[-0.0865696 -0.0932412 0.0501032 0.0070481 0.0198802 -0.0129471 -0.0303309 -0.0561734 -0.0786280 -0.1039486 ];<br />vy=[-0.0283387 -0.0447400 -0.0706520 -0.0859012 -0.0924338 -0.1009400 -0.1058732 -0.1108179 -0.1144853 -0.1172428];<br /><br />champ1(x, y, vx, vy);<br /><br />but it is giving me back error:<br /><br />champ1(x, y, vx, vy);<br />!--error 999<br />champ1: first and third arguments have incompatible dimensions<br />at line 8 of exec file called by :<br />exec("C:/Users/Vesy/AppData/Local/Temp/SCI_TMP_1232_/Untitled1.sce");<br />in execstr instruction called by :<br /><br />what am I doing wrong? whole matrix contains 640 particles that I would like to draw, this is only test matrix with 10 entries. I think that either there is problem with matrix entries or maybe I should use another function?<br /><br />thx for help :)vvhttps://www.blogger.com/profile/10038261742215917861noreply@blogger.comtag:blogger.com,1999:blog-9101701713138538731.post-72333610978358361182011-07-09T10:56:55.694-03:002011-07-09T10:56:55.694-03:00For reading 4 columns from a file, I suggest you u...For reading 4 columns from a file, I suggest you use it:<br /><br />x = read("test_data.dat", -1, 4);<br /><br />v1 = x(:,1); // first column<br /><br />v2 = x(:,2); // second column<br /><br />v3 = x(:,3); // third column<br /><br />v4 = x(:,4); // fourth column<br /><br /><br /><br />About other questions you have, I suggest you look the Labels, in the right side of the page.<br /><br />Regards.Sheephttps://www.blogger.com/profile/14503428177777397005noreply@blogger.comtag:blogger.com,1999:blog-9101701713138538731.post-36056578002309274582011-07-09T03:34:43.445-03:002011-07-09T03:34:43.445-03:00also if u could tell me the same for a 3d vector p...also if u could tell me the same for a 3d vector plot. .. in matlab one uses quiver and quiver3 for 2d and 3d vector plots. for scilab, now i know champ1 ..what abt 3d plots?Shaistahttps://www.blogger.com/profile/12713571200523986779noreply@blogger.comtag:blogger.com,1999:blog-9101701713138538731.post-33570081918013297812011-07-09T03:32:09.580-03:002011-07-09T03:32:09.580-03:00Thanks sheep!
but i still face problems ..
I have ...Thanks sheep!<br />but i still face problems ..<br />I have a file with four columns<br />To read the first column, i used:<br />------------------<br />-->y3 = read("test_data.dat", -1,1) <br />---------------<br />but what if I want to read all rows from just the second column?<br />If I use:<br />------------------<br />-->y3 = read("test_data.dat", -1,2) <br />---------------<br />it reads the first two columns ...<br />i need to assign different variables to different columns..<br />can u help?Shaistahttps://www.blogger.com/profile/12713571200523986779noreply@blogger.comtag:blogger.com,1999:blog-9101701713138538731.post-76501686357310206082011-07-08T10:44:45.314-03:002011-07-08T10:44:45.314-03:00Hi everyone, I've seen some people are looking...Hi everyone, I've seen some people are looking for plotting vectors from data in files.<br /><br />This post: http://usingscilab.blogspot.com/2009/03/using-files.html presents how to read columns from files and for plotting vectors, you can follow what is presented in the actual post.<br /><br />Regards.Sheephttps://www.blogger.com/profile/14503428177777397005noreply@blogger.comtag:blogger.com,1999:blog-9101701713138538731.post-32424685867946016792011-07-08T09:56:44.493-03:002011-07-08T09:56:44.493-03:00hey
I liked ur blog ...its quite helpful..
I am a...hey <br />I liked ur blog ...its quite helpful..<br />I am a beginnner ...n I have been trying to find out how to read columns from a file ..for a vector plot ..can u help?Shaistahttps://www.blogger.com/profile/12713571200523986779noreply@blogger.comtag:blogger.com,1999:blog-9101701713138538731.post-60947813642454967562011-02-18T21:09:14.705-03:002011-02-18T21:09:14.705-03:00Yes,Sheep, you are right. Thank you very much!Yes,Sheep, you are right. Thank you very much!ruy699https://www.blogger.com/profile/14620470949242350767noreply@blogger.comtag:blogger.com,1999:blog-9101701713138538731.post-24270519912569950622011-02-14T17:48:25.119-03:002011-02-14T17:48:25.119-03:00Hi Ruy, I changed some things at your code, but I ...Hi Ruy, I changed some things at your code, but I think you can understand, try to execute it:<br /><br />x = .01:.01:1;<br />y = .01:.01:1;<br /><br />[xv yv] = meshgrid(x, y);<br /><br />Q = 10;<br />d = 0.1;<br />K = 9000000000;<br /><br />Ex = (K*Q*xv)./((xv.^2 + yv.^2).^(3/2));<br />Ey = (K*Q*yv)./((xv.^2 + yv.^2).^(3/2));<br /><br />champ(x, y, Ex, Ey);<br /><br /><br />The variables Ex and Ey must be matrices, so you may use meshgrid() function for transforming (x, y) in matrices for calculating Ex and Ey.<br /><br />And other thing, look the dot '.' before the pow operator '^', it makes the operator being applied to each element.Sheephttps://www.blogger.com/profile/14503428177777397005noreply@blogger.comtag:blogger.com,1999:blog-9101701713138538731.post-34986461637860196172011-02-14T14:15:17.996-03:002011-02-14T14:15:17.996-03:00(sorry for my language faults, I am not english sp...(sorry for my language faults, I am not english speaker)<br />Hi. I think this blog is great!<br /><br />I tried these script:<br />x=.01:.01:1;y=.01:.01:1;<br />Ex = (K*Q*x) ./ ((x^2 + y^2)^(3/2))<br />Ey = (K*Q*y) ./ ((x^2 + y^2)^(3/2))<br />Q=10<br />d=0.1<br />K=9000000000<br />champ (x,y,Ex,Ey)<br /><br />But i obtain these error mesage:<br /><br />champ: first and third arguments have incompatible dimensions.<br /><br />Any idea about where is my mistake?ruy699https://www.blogger.com/profile/14620470949242350767noreply@blogger.comtag:blogger.com,1999:blog-9101701713138538731.post-85845220154743491122010-10-07T11:34:15.073-03:002010-10-07T11:34:15.073-03:00Dear Kamil, try the function champ(.) like this:
...Dear Kamil, try the function champ(.) like this:<br /><br />champ(x, y, xv', yv', 0.5);<br /><br />If it doesn't work, please, post your code and I'll try to solve your problem.<br /><br />God bless you.Sheephttps://www.blogger.com/profile/14503428177777397005noreply@blogger.comtag:blogger.com,1999:blog-9101701713138538731.post-37426189307057176422010-10-05T22:35:05.230-03:002010-10-05T22:35:05.230-03:00hi there, its me again,
i understand that the vec...hi there, its me again,<br /><br />i understand that the vector is automatically scale to the x-axis and y-axis range, does it?<br /><br />my problem is that i have set of data which does not have the same interval; as in my previous question. the vector plot then become very small in which i can only see the arrow head and not the line. <br /><br />do you know how to overcome this problem? hope to hear from you soon. tq in advance.KamilAbdullahhttps://www.blogger.com/profile/04425732524314297071noreply@blogger.comtag:blogger.com,1999:blog-9101701713138538731.post-48004795818416967362010-09-17T06:56:16.915-03:002010-09-17T06:56:16.915-03:00Thanks for your respond its really help. I will pu...Thanks for your respond its really help. I will put more question rather than comments if you dont mind. :D<br /><br />anyway glad to find someone willing to share knowledge like you.KamilAbdullahhttps://www.blogger.com/profile/04425732524314297071noreply@blogger.comtag:blogger.com,1999:blog-9101701713138538731.post-25760986553155842232010-09-16T10:08:46.560-03:002010-09-16T10:08:46.560-03:00Hello Kamil, may I call you like this?
You can ma...Hello Kamil, may I call you like this?<br /><br />You can make all questions you have, no problem.<br /><br />I'm happy because you solved your problem, and about the new sequence:<br /><br />x = 0, 3, 6, ..., 15<br /><br />you make the following code:<br /><br />x = 0:3:15;<br /><br />the number '3' between '0' and '15' is the step of the sequence.<br /><br />If you make the code:<br /><br />x = 0:15;<br /><br />the step is 1 (default value).<br /><br />Thanks for your comments and you are welcome to comment more.Sheephttps://www.blogger.com/profile/14503428177777397005noreply@blogger.comtag:blogger.com,1999:blog-9101701713138538731.post-21378187672452625822010-09-16T04:03:33.746-03:002010-09-16T04:03:33.746-03:00hi its me again.
i already capable of ploting my ...hi its me again.<br /><br />i already capable of ploting my vector plot as base on your instruction. thank you.<br /><br />i just want to know if is it possible to have an increment in the x and y value?<br /><br />for example<br />--> x = -5:5;<br /><br />means that -5,-4,....,4,5<br /><br />is it possible for me to create x and y axis value to be in the order of 0,3,6,...,15...<br /><br />i know it such a basic question for your but as a newbie i dont know this.<br /><br />anyway thanks again.KamilAbdullahhttps://www.blogger.com/profile/04425732524314297071noreply@blogger.comtag:blogger.com,1999:blog-9101701713138538731.post-47034416678548339382010-09-15T16:51:53.398-03:002010-09-15T16:51:53.398-03:00i am the last commenter,
i understand the "w...i am the last commenter,<br /><br />i understand the "write" and "read" command available on the post but i have a problem to declare the vx value and vy value as available in the data file.<br /><br />here some conclusion of mine, correct me if i am wrong:<br /><br />1. declaring the x-axis range<br />2. declaring the y-axis range<br />3. declaring the vx and vy value<br />4. plot using champ(.)<br /><br />waiting for your commentsKamilAbdullahhttps://www.blogger.com/profile/04425732524314297071noreply@blogger.comtag:blogger.com,1999:blog-9101701713138538731.post-16270858186643131112010-09-15T14:44:32.849-03:002010-09-15T14:44:32.849-03:00Hi last commenter, have you tried to use files?
I...Hi last commenter, have you tried to use files?<br /><br />I wrote posts about files here in this blog.<br /><br />If it's not, I ask you try to be more explained.<br /><br />Thanks for your comment.<br />God bless you.Sheephttps://www.blogger.com/profile/14503428177777397005noreply@blogger.comtag:blogger.com,1999:blog-9101701713138538731.post-56162426507075372502010-09-15T14:33:20.751-03:002010-09-15T14:33:20.751-03:00hi... i know that this is an old post, but i just ...hi... i know that this is an old post, but i just found it know... i would like to know that how to plot a vector from a raw data provided by an external data using scilab.<br /><br />if you have any information on this please let me know. tqAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-9101701713138538731.post-16829078195851131202010-01-12T10:22:20.237-03:002010-01-12T10:22:20.237-03:00To color the vectors (instead of vectors being pro...To color the vectors (instead of vectors being proportional to the intensity of the field) use champ1 instead of champ.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-9101701713138538731.post-33474001172427198562009-07-28T18:28:12.543-03:002009-07-28T18:28:12.543-03:00great post.
any idea on how to color the vectors? ...great post.<br />any idea on how to color the vectors? i've seen some people do this in matlab.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-9101701713138538731.post-64295632005206411872009-06-08T12:02:38.651-03:002009-06-08T12:02:38.651-03:00I'd like to help who needs help in Scilab.
Tha...I'd like to help who needs help in Scilab.<br />Thanks for your comment.Sheephttps://www.blogger.com/profile/14503428177777397005noreply@blogger.comtag:blogger.com,1999:blog-9101701713138538731.post-39586339819289968612009-06-08T11:03:14.784-03:002009-06-08T11:03:14.784-03:00I was very happy to discover your blog!
This post ...I was very happy to discover your blog!<br />This post was especially helpful to me, thanks a lot!!menoreply@blogger.com