Recent content by madtraveller

  1. M

    Can't read strange mixed format text file in Matlab

    Forgot adding the R code. R could really does this very easily with read.fwf :) data <- read.fwf("data.txt", widths=c(4,2,2,10,10,10,10,10) )
  2. M

    Can't read strange mixed format text file in Matlab

    Thank you very much MATLABdude. Your code really did the trick. Have a good weekend madtraveller
  3. M

    Creating a Multi Bar Plot in Matlab with Zeros and Proper Legends?

    Hello MATLABdude, I've just found out that you don't have to put small values at all. I just transpose my data frame "y" like this and it works nicely bar(y', 'group') However, the xlabel on x-axis still didn't display the way I want. Do you know a way to force all the labels...
  4. M

    Can't read strange mixed format text file in Matlab

    MATLABdude, Thank you. So there is no way to read that kind of file using Matlab? That's really strange to me tbh :) That's file was provided on a website and I can read it quite easily using R. However for some reasons I would like to read it using Matlab and don't want to call R script...
  5. M

    Can't read strange mixed format text file in Matlab

    I've just realized that the code suggested above didn't work correctly if I have a longer data like this. Again the first column is Year (4d format), 2nd column is Month (2d) and 3rd column is Day (2d) 1948 9 1 0.0000 5.3940 0.0292 35.4944 19.2500 1948 9 2 0.0000...
  6. M

    Creating a Multi Bar Plot in Matlab with Zeros and Proper Legends?

    Dear all, I still need help with this. The legend didn't display correctly with the above code and Matlab just plot the columns having non-zeros value instead of plotting all 16 columns Thx in advanced madtraveller
  7. M

    Creating a Multi Bar Plot in Matlab with Zeros and Proper Legends?

    Hi gb7nash, The first suggestion is kind of identical to what I did and it didn't work The second one didn't help either because what I need is to have 6 rows plotted beside each other with 6 different colors (16 columns x 6 color). In the end I will create a legend indicating 6 different color...
  8. M

    Creating a Multi Bar Plot in Matlab with Zeros and Proper Legends?

    Homework Statement I have a 6 x 16 data frame "y" which stands for 16 different soil types at 6 different depth as followings 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.37 0 0 0.50 0 0.03 0.03 0 0 0.02 0.05 0 0 0 0 0 0.26 0 0 0.34 0 0.02 0.02 0 0 0.33 0.03 0 0 0 0 0 0 0 0 0 0 0 0 0...
  9. M

    Can't read strange mixed format text file in Matlab

    Thank you so much jbunniii. It works perfectly now Have a great weekend madtraveller
  10. M

    Can't read strange mixed format text file in Matlab

    jbunniii, thank you for your answer As I stated: The first column is supposed to be year, 2nd is month and 3rd is day So The 1st row is 2000 Feb 8th The 2nd row is 2000 Feb 26th The 3rd row is 2000 March 5th ... The 7th row is 2000 April 7th So the format is fixed: 4d...
  11. M

    Can't read strange mixed format text file in Matlab

    Homework Statement I have to read a text file with fixed format as follows The first column is supposed to be year, 2nd is month and 3rd is day The file has following format: 4d 2d 2d f9.4 f9.4 f9.4 f9.4 4d 4d 4d 4d 4d 4d 2000 218 0.4546 0.2394 0.0761 0.1167 55 58 1 1...
  12. M

    Comp Sci C++: continuous reading file while doing calculation in between?

    Thanks. Maybe I'm just stupid but could you please be more detailed on your point?
  13. M

    Comp Sci C++: continuous reading file while doing calculation in between?

    Homework Statement I have 1 class for reading parameter from file (example below) and 1 class for doing calculation For every step, I'd like to read in parameter and do calculation in between. For i = 0 to number of lines in parameter file Read in parameter; Calculation; End...
  14. M

    How to use results from different classes into one class by reference?

    Hi again, Thx Mark44 for your correction. Last week I worked on correcting all stupid mistakes and now my program can run properly. - I had to create public functions to get the data instead of accessing a private member in series class; - In integral.h void do_integral( const series...
Back
Top