×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

can you people help me ?

can you people help me ?

can you people help me ?

(OP)
HI,

I am trying to learn to work on MATLAB by accessing the numerical data from an excel file. Kindly add your expert opinion.

For example :

in an excel file named "data.xls" , I have three columns:

CODE -->

Column1     Column2      Column3
0.1            1000       20.05
0.2            1250       21.56
0.3            1500       24.56
0.4            1750       27.14
0.5            2000      -17.25 


I want to import above data from excel into matlab and do following things , then plot them .

(1) Add column1 and column3 , store that as a new column or array.
(2) plot that array against column2 in matlab .

I have a more number of data and I have to do many trial and error methods to get the right plot. (may be you can say as fitting the curve too ) . I am tired doing it in excel ..., I want to do in matlab.

Can anyone please suggest the way?

Thanks from Basic Matlab Learner.

RE: can you people help me ?

I'd start by saving your Excel data a CSV file (text data), which will make it easier to work with in Matlab... maybe "data.csv". From there, you should be able to read your data into Matlab fairly easily with the dlmread function as a big array. One of the first things to become familiar with when learning Matlab is how to deal with arrays. For what you've given above, you might do something like this:

CODE --> Matlab

clear;clc;close all;
DATA = dlmread('data.csv',',',1,0)'; %Read data from file into matrix and transpose, skip the first row (assumes headers)
C1 = DATA(1,:);   %Variable for column 1
C2 = DATA(2,:);   %Variable for column 2
C3 = DATA(3,:);   %Variable for column 3

xx = C1+C3;       %Add column 1 and column 3, set to variable xx
yy = C2;          %Set column 2 to variable yy for readibility

%Plot xx and yy with circular markers and a solid, red line
plot(xx,yy,'o-','LineWidth',2,'Color','r'); 

RE: can you people help me ?

Hi , i need help please to read file (Python) on matlab.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login



News


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close