How can I have increment a counter when I push a buttom?

1 view (last 30 days)
Hi! I want to increment a counter and then use it to text on an Excel file. What I mean is that when I press the buttom Safe for examen Counter=1 so, in excel it would appear 1 Maria. When I press again the buttom again, it would appear in the same excel, another row 2 Maria
  3 Comments
Collegue
Collegue on 26 Jun 2017
Hello I want this:
I want to enter different parameters like Name Surname Telephone etc. and then, when I push a buttom to create a Excel with that data. After that I want to enter again data and save the information in the same Excel in another row.
Jan
Jan on 26 Jun 2017
This would be easy if "Excel file" means a CSV file and you simply append a new row. But if it is an open Excel session and you want to append a row to an existing spreadsheet, you have to import it at first to know the current size. This is not trivial.
The Matlab-Excel-Interaction is tedious. If you are not an experienced programmer with much spare time, I'd suggest to solve this either directly in Excel (which might be trivial) or to stay at Matlab and export the Excel file at the end only - if it is really required. (Sorry, I hate Excel.)
Currently the description is still too vague for an explicite code suggestion.

Sign in to comment.

Answers (0)

Categories

Find more on Data Import from MATLAB 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!