SlideShare a Scribd company logo
in the attachment you can find the matlab hw with the patterns
%%
clear all
close all
clc
%% 2 Methods for reading data from the file
%% Method 1 - read until the 'End of File' is reached
f_id=fopen('prog2_pattern1.txt');%1) open file with filename
i=1;
while ~feof(f_id)
col1(i)=fscanf(f_id,'%f',1);
col2(i)=fscanf(f_id,'%f',1);
i=i+1;
end
fclose(f_id); %close file for other apps to use
%% Method 2 - read all at once then parse data into separate
arrays
f_id=fopen('prog2_pattern1.txt');%1) open file with filename
all_data=fscanf(f_id,'%f');
for i=1:length(all_data)/2 %loop as many times as there are
rows in file
col3(i)=all_data(2*i-1);
col4(i)=all_data(2*i);
end
fclose(f_id); %close file for other apps to use

More Related Content

More from rochellscroop

In the Week 4 Case Study AssessmentResources, Mrs. Ashland w.docx
In the Week 4 Case Study AssessmentResources, Mrs. Ashland w.docxIn the Week 4 Case Study AssessmentResources, Mrs. Ashland w.docx
In the Week 4 Case Study AssessmentResources, Mrs. Ashland w.docx
rochellscroop
 
In the story The Lady or the Tiger , which comes through the door, t.docx
In the story The Lady or the Tiger , which comes through the door, t.docxIn the story The Lady or the Tiger , which comes through the door, t.docx
In the story The Lady or the Tiger , which comes through the door, t.docx
rochellscroop
 
In the third week of the session, you will submit a review of a scho.docx
In the third week of the session, you will submit a review of a scho.docxIn the third week of the session, you will submit a review of a scho.docx
In the third week of the session, you will submit a review of a scho.docx
rochellscroop
 
In The Road Not Taken,” Robert Frost writes figuratively about the .docx
In The Road Not Taken,” Robert Frost writes figuratively about the .docxIn The Road Not Taken,” Robert Frost writes figuratively about the .docx
In The Road Not Taken,” Robert Frost writes figuratively about the .docx
rochellscroop
 
In the scenarios and resulting simulations, Robert Donovan, a Jurisv.docx
In the scenarios and resulting simulations, Robert Donovan, a Jurisv.docxIn the scenarios and resulting simulations, Robert Donovan, a Jurisv.docx
In the scenarios and resulting simulations, Robert Donovan, a Jurisv.docx
rochellscroop
 
In the past weeks, students have learned about leaders and leaders.docx
In the past weeks, students have learned about leaders and leaders.docxIn the past weeks, students have learned about leaders and leaders.docx
In the past weeks, students have learned about leaders and leaders.docx
rochellscroop
 
In the poem, The Terrorist, He Watches” by Wislawa Szmborska, how w.docx
In the poem, The Terrorist, He Watches” by Wislawa Szmborska, how w.docxIn the poem, The Terrorist, He Watches” by Wislawa Szmborska, how w.docx
In the poem, The Terrorist, He Watches” by Wislawa Szmborska, how w.docx
rochellscroop
 
In the midsized town of Centervale, there is no more crime than one .docx
In the midsized town of Centervale, there is no more crime than one .docxIn the midsized town of Centervale, there is no more crime than one .docx
In the midsized town of Centervale, there is no more crime than one .docx
rochellscroop
 
In the movie, the school board decides to make Coach Boone the head .docx
In the movie, the school board decides to make Coach Boone the head .docxIn the movie, the school board decides to make Coach Boone the head .docx
In the movie, the school board decides to make Coach Boone the head .docx
rochellscroop
 
In the mid-seventeenth century, Dutch scientist Jan Baptista van Hel.docx
In the mid-seventeenth century, Dutch scientist Jan Baptista van Hel.docxIn the mid-seventeenth century, Dutch scientist Jan Baptista van Hel.docx
In the mid-seventeenth century, Dutch scientist Jan Baptista van Hel.docx
rochellscroop
 
In the early 20th century, the specter of infectious disease lurke.docx
In the early 20th century, the specter of infectious disease lurke.docxIn the early 20th century, the specter of infectious disease lurke.docx
In the early 20th century, the specter of infectious disease lurke.docx
rochellscroop
 
In the Group Wiki, write by Day 5 a summary to address the follo.docx
In the Group Wiki, write by Day 5 a summary to address the follo.docxIn the Group Wiki, write by Day 5 a summary to address the follo.docx
In the Group Wiki, write by Day 5 a summary to address the follo.docx
rochellscroop
 
In the handout itself Develop your handout in such a way that i.docx
In the handout itself Develop your handout in such a way that i.docxIn the handout itself Develop your handout in such a way that i.docx
In the handout itself Develop your handout in such a way that i.docx
rochellscroop
 
In the future, with advanced Electronic Medical Record (EMR) and Com.docx
In the future, with advanced Electronic Medical Record (EMR) and Com.docxIn the future, with advanced Electronic Medical Record (EMR) and Com.docx
In the future, with advanced Electronic Medical Record (EMR) and Com.docx
rochellscroop
 
In the early childhood setting, communication and conferences help p.docx
In the early childhood setting, communication and conferences help p.docxIn the early childhood setting, communication and conferences help p.docx
In the early childhood setting, communication and conferences help p.docx
rochellscroop
 
IN the first paragraph, explain who is Chris Columbus as explorer an.docx
IN the first paragraph, explain who is Chris Columbus as explorer an.docxIN the first paragraph, explain who is Chris Columbus as explorer an.docx
IN the first paragraph, explain who is Chris Columbus as explorer an.docx
rochellscroop
 
In the Comparing Regions” Discussion, you examined how differences .docx
In the Comparing Regions” Discussion, you examined how differences .docxIn the Comparing Regions” Discussion, you examined how differences .docx
In the Comparing Regions” Discussion, you examined how differences .docx
rochellscroop
 
In the Humanities Project, you will compare and contrast two figur.docx
In the Humanities Project, you will compare and contrast two figur.docxIn the Humanities Project, you will compare and contrast two figur.docx
In the Humanities Project, you will compare and contrast two figur.docx
rochellscroop
 
In the early years of the new century, it wasn’t hard to see that Iv.docx
In the early years of the new century, it wasn’t hard to see that Iv.docxIn the early years of the new century, it wasn’t hard to see that Iv.docx
In the early years of the new century, it wasn’t hard to see that Iv.docx
rochellscroop
 
In the autoimmune disease Multiple Sclerosis, the immune system dest.docx
In the autoimmune disease Multiple Sclerosis, the immune system dest.docxIn the autoimmune disease Multiple Sclerosis, the immune system dest.docx
In the autoimmune disease Multiple Sclerosis, the immune system dest.docx
rochellscroop
 

More from rochellscroop (20)

In the Week 4 Case Study AssessmentResources, Mrs. Ashland w.docx
In the Week 4 Case Study AssessmentResources, Mrs. Ashland w.docxIn the Week 4 Case Study AssessmentResources, Mrs. Ashland w.docx
In the Week 4 Case Study AssessmentResources, Mrs. Ashland w.docx
 
In the story The Lady or the Tiger , which comes through the door, t.docx
In the story The Lady or the Tiger , which comes through the door, t.docxIn the story The Lady or the Tiger , which comes through the door, t.docx
In the story The Lady or the Tiger , which comes through the door, t.docx
 
In the third week of the session, you will submit a review of a scho.docx
In the third week of the session, you will submit a review of a scho.docxIn the third week of the session, you will submit a review of a scho.docx
In the third week of the session, you will submit a review of a scho.docx
 
In The Road Not Taken,” Robert Frost writes figuratively about the .docx
In The Road Not Taken,” Robert Frost writes figuratively about the .docxIn The Road Not Taken,” Robert Frost writes figuratively about the .docx
In The Road Not Taken,” Robert Frost writes figuratively about the .docx
 
In the scenarios and resulting simulations, Robert Donovan, a Jurisv.docx
In the scenarios and resulting simulations, Robert Donovan, a Jurisv.docxIn the scenarios and resulting simulations, Robert Donovan, a Jurisv.docx
In the scenarios and resulting simulations, Robert Donovan, a Jurisv.docx
 
In the past weeks, students have learned about leaders and leaders.docx
In the past weeks, students have learned about leaders and leaders.docxIn the past weeks, students have learned about leaders and leaders.docx
In the past weeks, students have learned about leaders and leaders.docx
 
In the poem, The Terrorist, He Watches” by Wislawa Szmborska, how w.docx
In the poem, The Terrorist, He Watches” by Wislawa Szmborska, how w.docxIn the poem, The Terrorist, He Watches” by Wislawa Szmborska, how w.docx
In the poem, The Terrorist, He Watches” by Wislawa Szmborska, how w.docx
 
In the midsized town of Centervale, there is no more crime than one .docx
In the midsized town of Centervale, there is no more crime than one .docxIn the midsized town of Centervale, there is no more crime than one .docx
In the midsized town of Centervale, there is no more crime than one .docx
 
In the movie, the school board decides to make Coach Boone the head .docx
In the movie, the school board decides to make Coach Boone the head .docxIn the movie, the school board decides to make Coach Boone the head .docx
In the movie, the school board decides to make Coach Boone the head .docx
 
In the mid-seventeenth century, Dutch scientist Jan Baptista van Hel.docx
In the mid-seventeenth century, Dutch scientist Jan Baptista van Hel.docxIn the mid-seventeenth century, Dutch scientist Jan Baptista van Hel.docx
In the mid-seventeenth century, Dutch scientist Jan Baptista van Hel.docx
 
In the early 20th century, the specter of infectious disease lurke.docx
In the early 20th century, the specter of infectious disease lurke.docxIn the early 20th century, the specter of infectious disease lurke.docx
In the early 20th century, the specter of infectious disease lurke.docx
 
In the Group Wiki, write by Day 5 a summary to address the follo.docx
In the Group Wiki, write by Day 5 a summary to address the follo.docxIn the Group Wiki, write by Day 5 a summary to address the follo.docx
In the Group Wiki, write by Day 5 a summary to address the follo.docx
 
In the handout itself Develop your handout in such a way that i.docx
In the handout itself Develop your handout in such a way that i.docxIn the handout itself Develop your handout in such a way that i.docx
In the handout itself Develop your handout in such a way that i.docx
 
In the future, with advanced Electronic Medical Record (EMR) and Com.docx
In the future, with advanced Electronic Medical Record (EMR) and Com.docxIn the future, with advanced Electronic Medical Record (EMR) and Com.docx
In the future, with advanced Electronic Medical Record (EMR) and Com.docx
 
In the early childhood setting, communication and conferences help p.docx
In the early childhood setting, communication and conferences help p.docxIn the early childhood setting, communication and conferences help p.docx
In the early childhood setting, communication and conferences help p.docx
 
IN the first paragraph, explain who is Chris Columbus as explorer an.docx
IN the first paragraph, explain who is Chris Columbus as explorer an.docxIN the first paragraph, explain who is Chris Columbus as explorer an.docx
IN the first paragraph, explain who is Chris Columbus as explorer an.docx
 
In the Comparing Regions” Discussion, you examined how differences .docx
In the Comparing Regions” Discussion, you examined how differences .docxIn the Comparing Regions” Discussion, you examined how differences .docx
In the Comparing Regions” Discussion, you examined how differences .docx
 
In the Humanities Project, you will compare and contrast two figur.docx
In the Humanities Project, you will compare and contrast two figur.docxIn the Humanities Project, you will compare and contrast two figur.docx
In the Humanities Project, you will compare and contrast two figur.docx
 
In the early years of the new century, it wasn’t hard to see that Iv.docx
In the early years of the new century, it wasn’t hard to see that Iv.docxIn the early years of the new century, it wasn’t hard to see that Iv.docx
In the early years of the new century, it wasn’t hard to see that Iv.docx
 
In the autoimmune disease Multiple Sclerosis, the immune system dest.docx
In the autoimmune disease Multiple Sclerosis, the immune system dest.docxIn the autoimmune disease Multiple Sclerosis, the immune system dest.docx
In the autoimmune disease Multiple Sclerosis, the immune system dest.docx
 

Recently uploaded

RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
zuzanka
 
A Free 200-Page eBook ~ Brain and Mind Exercise.pptx
A Free 200-Page eBook ~ Brain and Mind Exercise.pptxA Free 200-Page eBook ~ Brain and Mind Exercise.pptx
A Free 200-Page eBook ~ Brain and Mind Exercise.pptx
OH TEIK BIN
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
zuzanka
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
Nguyen Thanh Tu Collection
 
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
EduSkills OECD
 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
nitinpv4ai
 
220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology
Kalna College
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Henry Hollis
 
220711130083 SUBHASHREE RAKSHIT Internet resources for social science
220711130083 SUBHASHREE RAKSHIT  Internet resources for social science220711130083 SUBHASHREE RAKSHIT  Internet resources for social science
220711130083 SUBHASHREE RAKSHIT Internet resources for social science
Kalna College
 
How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17
Celine George
 
HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.
deepaannamalai16
 
Pharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brubPharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brub
danielkiash986
 
CIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdfCIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdf
blueshagoo1
 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
Mohammad Al-Dhahabi
 
KHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGH
KHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGHKHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGH
KHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGH
shreyassri1208
 
Data Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsxData Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsx
Prof. Dr. K. Adisesha
 
Contiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptxContiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptx
Kalna College
 
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
MJDuyan
 
Bonku-Babus-Friend by Sathyajith Ray (9)
Bonku-Babus-Friend by Sathyajith Ray  (9)Bonku-Babus-Friend by Sathyajith Ray  (9)
Bonku-Babus-Friend by Sathyajith Ray (9)
nitinpv4ai
 
Ch-4 Forest Society and colonialism 2.pdf
Ch-4 Forest Society and colonialism 2.pdfCh-4 Forest Society and colonialism 2.pdf
Ch-4 Forest Society and colonialism 2.pdf
lakshayrojroj
 

Recently uploaded (20)

RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
 
A Free 200-Page eBook ~ Brain and Mind Exercise.pptx
A Free 200-Page eBook ~ Brain and Mind Exercise.pptxA Free 200-Page eBook ~ Brain and Mind Exercise.pptx
A Free 200-Page eBook ~ Brain and Mind Exercise.pptx
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
 
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
 
220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
 
220711130083 SUBHASHREE RAKSHIT Internet resources for social science
220711130083 SUBHASHREE RAKSHIT  Internet resources for social science220711130083 SUBHASHREE RAKSHIT  Internet resources for social science
220711130083 SUBHASHREE RAKSHIT Internet resources for social science
 
How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17
 
HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.
 
Pharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brubPharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brub
 
CIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdfCIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdf
 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
 
KHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGH
KHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGHKHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGH
KHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGH
 
Data Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsxData Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsx
 
Contiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptxContiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptx
 
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
 
Bonku-Babus-Friend by Sathyajith Ray (9)
Bonku-Babus-Friend by Sathyajith Ray  (9)Bonku-Babus-Friend by Sathyajith Ray  (9)
Bonku-Babus-Friend by Sathyajith Ray (9)
 
Ch-4 Forest Society and colonialism 2.pdf
Ch-4 Forest Society and colonialism 2.pdfCh-4 Forest Society and colonialism 2.pdf
Ch-4 Forest Society and colonialism 2.pdf
 

in the attachment you can find the matlab hw with the patterns.docx

  • 1. in the attachment you can find the matlab hw with the patterns %% clear all close all clc %% 2 Methods for reading data from the file %% Method 1 - read until the 'End of File' is reached f_id=fopen('prog2_pattern1.txt');%1) open file with filename i=1; while ~feof(f_id) col1(i)=fscanf(f_id,'%f',1); col2(i)=fscanf(f_id,'%f',1); i=i+1; end fclose(f_id); %close file for other apps to use
  • 2. %% Method 2 - read all at once then parse data into separate arrays f_id=fopen('prog2_pattern1.txt');%1) open file with filename all_data=fscanf(f_id,'%f'); for i=1:length(all_data)/2 %loop as many times as there are rows in file col3(i)=all_data(2*i-1); col4(i)=all_data(2*i); end fclose(f_id); %close file for other apps to use