ask to an user a *.txt file

3 views (last 30 days)
Miguel Valencia
Miguel Valencia on 18 Sep 2013
Good Afternoon, i'm trying to make a program that ask to the user the name of the file, and the program edit that file, i don´t know what i have to do, because when use this code: file=input('file name','s'); tamiz=importdata('file.txt'); i get this >> proyectosuelos file nameTamiz1 Error using importdata (line 137) Unable to open file.
Error in proyectosuelos (line 2)
tamiz=importdata('file.txt');
Thanks.

Answers (1)

Azzi Abdelmalek
Azzi Abdelmalek on 18 Sep 2013
file=input('file name','s');
tamiz=importdata([file '.txt']);

Categories

Find more on Data Import and Analysis in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!