Search Results

Search found 95 results on 4 pages for 'ldigas'.

Page 4/4 | < Previous Page | 1 2 3 4 

  • matlab precision determint problem

    - by ldigas
    I have the following program format compact; format short g; clear; clc; L = 140; J = 77; Jm = 10540; G = 0.8*10^8; d = L/3; for i=1:500000 omegan=1.+0.0001*i; a(1,1) = ((omegan^2)*(Jm/(G*J))*d^2)-2; a(1,2) = 2; a(1,3) = 0; a(1,4) = 0; a(2,1) = 1; a(2,2) = ((omegan^2)*(Jm/(G*J))*d^2)-2; a(2,3) = 1; a(2,4) = 0; a(3,1) = 0; a(3,2) = 1; a(3,3) = ((omegan^2)*(Jm/(G*J))*d^2)-2; a(3,4) = 1; a(4,1) = 0; a(4,2) = 0; a(4,3) = 2; a(4,4) = ((omegan^2)*(Jm/(G*J))*d^2)-2; if(abs(det(a))<1E-10) sprintf('omegan= %8.3f det= %8.3f',omegan,det(a)) end end Analytical solution of the above system, and the same program written in fortran gives out values of omegan equal to 16.3818 and 32.7636 (fortran values; analytical differ a little, but they're there somewhere). So, now I'm wondering ... where am I going wrong with this ? Why is matlab not giving the expected results ? (this is probably something terribly simple, but it's giving me headaches)

    Read the article

  • matlab precision determinant problem

    - by ldigas
    I have the following program format compact; format short g; clear; clc; L = 140; J = 77; Jm = 10540; G = 0.8*10^8; d = L/3; for i=1:500000 omegan=1.+0.0001*i; a(1,1) = ((omegan^2)*(Jm/(G*J))*d^2)-2; a(1,2) = 2; a(1,3) = 0; a(1,4) = 0; a(2,1) = 1; a(2,2) = ((omegan^2)*(Jm/(G*J))*d^2)-2; a(2,3) = 1; a(2,4) = 0; a(3,1) = 0; a(3,2) = 1; a(3,3) = ((omegan^2)*(Jm/(G*J))*d^2)-2; a(3,4) = 1; a(4,1) = 0; a(4,2) = 0; a(4,3) = 2; a(4,4) = ((omegan^2)*(Jm/(G*J))*d^2)-2; if(abs(det(a))<1E-10) sprintf('omegan= %8.3f det= %8.3f',omegan,det(a)) end end Analytical solution of the above system, and the same program written in fortran gives out values of omegan equal to 16.3818 and 32.7636 (fortran values; analytical differ a little, but they're there somewhere). So, now I'm wondering ... where am I going wrong with this ? Why is matlab not giving the expected results ? (this is probably something terribly simple, but it's giving me headaches)

    Read the article

  • Calling and leaving gnuplot prompt and png export

    - by ldigas
    a) I have a data file with, well ... data, and a .gnu file with gnuplot commands. If I call gnuplot like this: gnuplot -p commands_file.gnu I'll get the graph on screen and when I close it, gnuplot will be in it's own prompt (gnuplot_). How can I make it just show the graph, and put me back on cmd prompt after I close it ? b) How to "export" that graph to png or something insertable in Word ? I know there are a dozen tutorials for this on the 'net, but I'm having trouble just finding a simple example.

    Read the article

  • What would you suggest as a high school first language?

    - by ldigas
    Edit by OA: After reading some answers I'll just update the question a little. At first I put it a little bluntly, but some of those gave me some good arguments which have to be taken into consideration while making a stand on this one. (these are mostly picked up from comments and answers below). A few things to take into account: to many pupils this is a first programming language - at this stage most of them have trouble grasping a difference between data types, variable passing, ... and whatnot, less alone pointers and similar 'low level stuff' :) they will all have to pass this to get into next grade (well, big majority of them anyway) not all of them have computers at home, not all of them are willing to learn this, less alone interested in - so the concepts have to be taught on a finite time scale in school hours (as well as practice on computers) free literature is a bonus - the teacher will make some scripts and handaways, but still ... I wouldn't like to bear the parents with the burden of buying expensive literature (also, english is not a native language here ... and although they are all learning it, their ability to read it fluently is somewhat questionable) somebody gave an argument - "a language which does not get in the way of ideas" - good one accessibility on different platforms in not expecially important at this point - although most of the suggested ones are available on win as well as linux - not many macs in this part of europe (their prices are sky high for anything but specialised usage) I will check what are the licencing issues on ms express editions about using it massively in high schools for purposes like this - if someone has any info about this, please, do not be shy with it :) A friend of mine, informatics teacher - in EU it comes as something as junior cs teacher, in a local high school asked me what I thought about what should be the first language pupils should be taught? It is a technical school (a little more oriented towards mathematics than the gymnasium, but not computer oriented totally). So I'm asking you - what do you think should be the first language pupils are exposed to in highschool? They have been teaching Pascal so far, but she's not sure that's a good course. She thought about switching to C (which I resented; considering not all pupils have interests in programming, to start with, and should be taught something higher level since they are just gripping the idea of a loop and such ... for a start), I suggested python or ruby (preferably py since it handles all paradigms). What is your opinion on this one? I looked, but didn't find a similar question on SO, so if there is one, please just point me towards it. Edit: The assumption is that none of the pupils have been exposed to any programming in junior school. See also: What is the best way to teach young kids some basic programming concepts? Best ways to teach a beginner to program How and when do you teach a kid to code What is the easiest language to start with? High School Programming

    Read the article

  • What is lisp used for today and where do you think it's going ?

    - by ldigas
    Never been a lisp user, so don't take me as too dense while reading this. But what is lisp used for today ? I know there are several variants of the language in existence, at least one which will keep it alive commercially for a while longer (AutoLisp, VisualLisp - pretty big support from Autodesk) ... but I don't meet everyday people using it. So if you can shed some light on the matter - what is it's primary target market nowadays ? And what do you believe its future will be ... will it become just another support language in few apps, or is it going somewhere ? Also, apart from "an editor whose name shall not be spoken" what other apps keep it as a support language ?

    Read the article

  • Plotting two axes in gnuplot

    - by ldigas
    Is it possible to plot two curves, with two corresponding axes in gnuplot, each of which has a different scale. For example, y=x*2. and y=x*4. in the same graph (they vary enough for them to be "uncomfortable" placed with the same scale) ?

    Read the article

  • Why does file have to be saved prior to running ?

    - by ldigas
    In MATLAB, why does the file have to be saved prior to running ? I often try quick snippets of code, which I could also easily run also on the Command Window line by line. So, why when I run them through the editor, I have to save them first ? Can this behaviour be changed, maybe ?

    Read the article

  • Using MATLAB's plotting features as an interactive part of a Fortran program

    - by ldigas
    Although many of you will have a decent idea of what I'm aiming at, just from reading the title -- allow me a simple introduction still. I have a Fortran program - it consists of a program, some internal subroutines, 7 modules with its own procedures, and ... uhmm, that's it. Without going into much detail, for I don't think it's necessary at this point, what would be the easiest way to use MATLAB's plotting features (mainly plot(x,y) with some customizations) as an interactive part of my program ? For now I'm using some of my own custom plotting routines (based on HPGL and Calcomp's routines), but just as part of an exercise on my part, I'd like to see where this could go and how would it work (is it even possible what I'm suggesting?). Also, how much effort would it take on my part ? I know this subject has been rather extensively described in many "tutorials" on the net, but for some reason I have trouble finding the really simple yet illustrative introductory ones. So if anyone can post an example or two, simple ones, I'd be really grateful. Or just take me by the hand and guide me through one working example. platform: IVF 11.something :) on Win XP SP2, Matlab 2008b

    Read the article

  • What are CAD apps written in, and how are they organized ?

    - by ldigas
    What are CAD applications (Rhino, Autocad) of today written in and how are they organized internally ? I gave as an example, Autocad and Rhino, although I would love to hear of other examples as well. I'm particularly interested in knowing what is their backend written in (multilanguage ?) and how is it organized, and how do they handle their frontend (GUI) in real time ? Do they use native windows API's or some libraries of their own, since I imagine, as good as may be, the open source solutions on today's market won't cut it. I may be wrong ... As most of you who have used them know, they handle amongs other things relatively complex rotational operations in realtime (shading is not interesting me). I've been doing some experiments with several packages recently, and for some larger models found that there is considerable difference in speed in, for example, programed rotation (big full ship models) amongst some of them (which I won't name). So I'm wondering about their internals ... Also, if someone knows of some book on the subject, I'd be interested to hear of it.

    Read the article

  • How to prompt for input using an existing variable in the prompt.

    - by ldigas
    I'm trying to ask the user for a value of some variable, but at the same time, showing him the last value used (at the termination of the program, the values are saved to a file, and loaded at the start of the program). Something like this: Enter new radius value (R=12.6) : ... user enters 12.7 ... Enter new pi value (pi=3.14) : Enter new height value (h=30.0) : Usually I would write the first one with write statement, then read the new one (in Fortran, for example). In MATLAB however, I don't know how to write something out with input statement. Are there some other statements for getting input ?

    Read the article

  • How to present a plot and then return to cmd prompt

    - by ldigas
    I have a data file, and a gnu file, in which my plotting commands are. How can I produce a plot in gnuplot, in a way that I call gnuplot giving it a name of the gnu file ... it gives me the window with a plot ... and after I close it, it returns me not to gnuplot command prompt, but to cmd (windows cmd.exe) command prompt ?

    Read the article

  • How to write a variable with input ?

    - by ldigas
    the title is somewhat vague, so let me explain I'm trying to ask the user for a value of some variable, but at the same time, showing him the last value used (at the termination of the program, the values are saved to a file, and loaded at the start of the program). Something like this: Enter new radius value (R=12.6) : ... user enters 12.7 ... Enter new pi value (pi=3.14) : Enter new height value (h=30.0) : Usually I would write the first one with write statement, then read the new one (in fortran, for example). In matlab however, I don't know how to write something out with input statement. Are there some other statements for getting input ? All your thoughts on the subject appreciated.

    Read the article

  • matlab's fortran's format equivalents

    - by ldigas
    What would be matlab's equivalent of write(1,'("Speed, resistance, power",3f8.2)')(a(i),i=1,3) I've tried a = [10. 20. 200.] fprintf(unit1,'a = 3%8.1e',a) but I'm still having trouble with it (the whole matlab output formatting thing). Edit for Kenny: for the values of a as given above, it would give (in a new row): Speed, resistance, power 10.00 20.00 200.00

    Read the article

< Previous Page | 1 2 3 4