how to write a function checking to see if a file is in a format of a 2 row matrix, and then creating separate arrays for each row

I want a function to be able to do the following: Load the .dat file. Then call a function that checks if the file is in the format of a 2 row matrix. If so, the function places the two rows in two arrays name X and Y, and returns the two arrays to the menu1 script; otherwise, it halts the entire program. I've tried various methods to get the data into this form but to no avail.

Asked:

on 20 Dec 2011

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!