Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I want to write a csv to specific folder in matlab within a loop for multiple data sets. Outside of the loop I have: basepath

I want to write a csv to specific folder in matlab within a loop for multiple data sets. Outside of the loop I have:

basepath = 'C:\Users\Example\Desktop'

session = 'Session 1'

Fieldnames = {'Name', 'output_path', 'Age'};

Subject_info = { {'Person A', Output Folder A', 25}

{'Person B', Output Folder B', 25}

};

And in the loop I want to write a csv to the output_path location for each person (i.e csv file for person A into Output Folder A). Currently I have something like:

writecsv('person_info.csv', person_info);

The csv files are being written correctly but I do not know how to save them anywhere other than the current directory so they just overwrite each other with each iteration of the loop.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Students also viewed these Databases questions

Question

2. To compare the costs of alternative training programs.

Answered: 1 week ago