SlideShare a Scribd company logo
1 of 3
Download to read offline
Hi,
I am running a simulation program.
There, in every simulation run it creates a data set of size T. I would like to
know if there's a loop I can use to divide this data set into 20 sub data sets of
equal size and randomly choose a data set, among the 20 sub data sets, to
be used in a different pat of the program.
any help is greatly appreciated.
Dav.
  0 Comments
 Comment on this Question
Divide a data set into sub data
sets
Asked by dav on 26 Sep 2013
Latest activity Commented on by dav on 27 Sep 2013
Accepted Answer by Azzi Abdelmalek
122 views (last 30 days)
matlabsimulationfor loop
Tags
No products are associated with this question.
Products
Related
Content
 2 Answers
Vote 1
Flag Link
Answer by Azzi Abdelmalek on 26 Sep 2013
 Accepted answer
A=1:100 % Example
data=reshape(A,[],20) % each column represent your part of data
id=randi(20)
random_vector=data(:,id)
  4 Comments
Show 1 older comment
 Comment on this Answer
I do not know what (sample a vector under sampling with replacement)
means. The code pick randomly a vector from the 20 parts, but it can pick
the same another time
Azzi Abdelmalek on 27 Sep 2013
If you want to avoid repetition
A=1:100 % Example
data=reshape(A,[],20) % each column represent your part of data
[n,m]=size(data);
id=randi(m)
random_vector=data(:,id)
data(:,id)=[]
Azzi Abdelmalek on 27 Sep 2013
thank you very much!
dav on 27 Sep 2013
Vote 1
Flag Link
Answer by Jan Simon on 27 Sep 2013
The question is not clear. You have T "data sets" (what ever this mean) and
want to divide it in 20 "sets" of equal size. Is T dividable by 20? Should the
new data sets contain repetitions, e.g. is this allowed:
aNewDataSet = [T(1), T(1), T(3:end)]
Should the new data sets be elementwise distinct or is this allowed:
newDataSet(1) = [T(1), T(3:10)]
newDataSet(2) = [T(1), T(4:11)]
When only one data set is used afterwards, why creating 20 of them at first?

More Related Content

Viewers also liked

Viewers also liked (20)

Kumpulan solusi permasalahan unbk jawara cloud
Kumpulan solusi permasalahan unbk   jawara cloudKumpulan solusi permasalahan unbk   jawara cloud
Kumpulan solusi permasalahan unbk jawara cloud
 
Tutorial zulfa mengenal menu home menggunakan keyboard
Tutorial zulfa mengenal menu home menggunakan keyboardTutorial zulfa mengenal menu home menggunakan keyboard
Tutorial zulfa mengenal menu home menggunakan keyboard
 
Petunjuk sikronisasi unbk_smk_dan_sma
Petunjuk sikronisasi unbk_smk_dan_smaPetunjuk sikronisasi unbk_smk_dan_sma
Petunjuk sikronisasi unbk_smk_dan_sma
 
Foreground detection using gaussian mixture models matlab
Foreground detection using gaussian mixture models   matlabForeground detection using gaussian mixture models   matlab
Foreground detection using gaussian mixture models matlab
 
4. jurnal budi pradana implementasi metode low pass filtering untuk mereduks...
4. jurnal budi pradana  implementasi metode low pass filtering untuk mereduks...4. jurnal budi pradana  implementasi metode low pass filtering untuk mereduks...
4. jurnal budi pradana implementasi metode low pass filtering untuk mereduks...
 
6. monika sianipar (1011493) perancangan aplikasi forecasting persediaan baha...
6. monika sianipar (1011493) perancangan aplikasi forecasting persediaan baha...6. monika sianipar (1011493) perancangan aplikasi forecasting persediaan baha...
6. monika sianipar (1011493) perancangan aplikasi forecasting persediaan baha...
 
Pengolahan citra
Pengolahan citraPengolahan citra
Pengolahan citra
 
20. implementasi data mining pada penjualan produk elektronik dengan algoritm...
20. implementasi data mining pada penjualan produk elektronik dengan algoritm...20. implementasi data mining pada penjualan produk elektronik dengan algoritm...
20. implementasi data mining pada penjualan produk elektronik dengan algoritm...
 
1 7 amir temu kembali informasi berbasis kluster untuk sistem temu kembali i...
1 7 amir  temu kembali informasi berbasis kluster untuk sistem temu kembali i...1 7 amir  temu kembali informasi berbasis kluster untuk sistem temu kembali i...
1 7 amir temu kembali informasi berbasis kluster untuk sistem temu kembali i...
 
Troubleshooting unbk 20170303
Troubleshooting unbk 20170303Troubleshooting unbk 20170303
Troubleshooting unbk 20170303
 
2. jurnal dessy purwandani implementasi metode gaussian smoothing untuk peng...
2. jurnal dessy purwandani  implementasi metode gaussian smoothing untuk peng...2. jurnal dessy purwandani  implementasi metode gaussian smoothing untuk peng...
2. jurnal dessy purwandani implementasi metode gaussian smoothing untuk peng...
 
Jurnal 15398 ilmplementasi k-nearest neighbor untuk mengenali pola citra dala...
Jurnal 15398 ilmplementasi k-nearest neighbor untuk mengenali pola citra dala...Jurnal 15398 ilmplementasi k-nearest neighbor untuk mengenali pola citra dala...
Jurnal 15398 ilmplementasi k-nearest neighbor untuk mengenali pola citra dala...
 
Using kalman filter for object tracking matlab & simulink example r
Using kalman filter for object tracking   matlab & simulink example rUsing kalman filter for object tracking   matlab & simulink example r
Using kalman filter for object tracking matlab & simulink example r
 
Motion based multiple object tracking - matlab & simulink example
Motion based multiple object tracking - matlab & simulink exampleMotion based multiple object tracking - matlab & simulink example
Motion based multiple object tracking - matlab & simulink example
 
Sejarah bem stkip subang
Sejarah bem stkip subangSejarah bem stkip subang
Sejarah bem stkip subang
 
Clustering skripsi teknik informatikac
Clustering   skripsi teknik informatikacClustering   skripsi teknik informatikac
Clustering skripsi teknik informatikac
 
Selayang pandang kiki rusdyanto
Selayang pandang kiki rusdyantoSelayang pandang kiki rusdyanto
Selayang pandang kiki rusdyanto
 
16. afrisawati implementasi data mining pemilihan pelanggan potensial menggu...
16. afrisawati  implementasi data mining pemilihan pelanggan potensial menggu...16. afrisawati  implementasi data mining pemilihan pelanggan potensial menggu...
16. afrisawati implementasi data mining pemilihan pelanggan potensial menggu...
 
Algoritma fuzzy c means fcm java c++ contoh program
Algoritma fuzzy c means fcm java c++   contoh programAlgoritma fuzzy c means fcm java c++   contoh program
Algoritma fuzzy c means fcm java c++ contoh program
 
11. sri rahayu implementasi data mining pada penjualan tiket pesawat menggu...
11. sri rahayu   implementasi data mining pada penjualan tiket pesawat menggu...11. sri rahayu   implementasi data mining pada penjualan tiket pesawat menggu...
11. sri rahayu implementasi data mining pada penjualan tiket pesawat menggu...
 

More from ym.ygrex@comp

More from ym.ygrex@comp (12)

Using kalman filter for object tracking matlab & simulink example
Using kalman filter for object tracking   matlab & simulink exampleUsing kalman filter for object tracking   matlab & simulink example
Using kalman filter for object tracking matlab & simulink example
 
Tracking pedestrians from a moving car matlab & simulink example hg
Tracking pedestrians from a moving car   matlab & simulink example hgTracking pedestrians from a moving car   matlab & simulink example hg
Tracking pedestrians from a moving car matlab & simulink example hg
 
Tracking pedestrians from a moving car matlab & simulink example g
Tracking pedestrians from a moving car   matlab & simulink example gTracking pedestrians from a moving car   matlab & simulink example g
Tracking pedestrians from a moving car matlab & simulink example g
 
Teknik pengumpulan data teknologi pendidikan
Teknik pengumpulan data   teknologi pendidikanTeknik pengumpulan data   teknologi pendidikan
Teknik pengumpulan data teknologi pendidikan
 
Pengertian field, record, table, file, data dan basis data lengkap pengerti...
Pengertian field, record, table, file, data dan basis data lengkap   pengerti...Pengertian field, record, table, file, data dan basis data lengkap   pengerti...
Pengertian field, record, table, file, data dan basis data lengkap pengerti...
 
Aplikasi text mining untuk automasi penentuan tren topik skripsi dengan metod...
Aplikasi text mining untuk automasi penentuan tren topik skripsi dengan metod...Aplikasi text mining untuk automasi penentuan tren topik skripsi dengan metod...
Aplikasi text mining untuk automasi penentuan tren topik skripsi dengan metod...
 
17. sarah fadilah implementasi data mining untuk pengenalan karakteristik t...
17. sarah fadilah   implementasi data mining untuk pengenalan karakteristik t...17. sarah fadilah   implementasi data mining untuk pengenalan karakteristik t...
17. sarah fadilah implementasi data mining untuk pengenalan karakteristik t...
 
Jurnal 15235 pengelompokan kayu kelapa menggunakan algoritma k-means
Jurnal 15235 pengelompokan kayu kelapa menggunakan algoritma k-meansJurnal 15235 pengelompokan kayu kelapa menggunakan algoritma k-means
Jurnal 15235 pengelompokan kayu kelapa menggunakan algoritma k-means
 
12. jaka putra implementasi histogram equalization untuk perbaikan noise pad...
12. jaka putra  implementasi histogram equalization untuk perbaikan noise pad...12. jaka putra  implementasi histogram equalization untuk perbaikan noise pad...
12. jaka putra implementasi histogram equalization untuk perbaikan noise pad...
 
Ruu bem unma subang 2013 ygrex
Ruu bem unma subang 2013 ygrexRuu bem unma subang 2013 ygrex
Ruu bem unma subang 2013 ygrex
 
Buku ppl stkip 2011
Buku ppl stkip 2011Buku ppl stkip 2011
Buku ppl stkip 2011
 
Selayang pandang ygrex
Selayang pandang ygrexSelayang pandang ygrex
Selayang pandang ygrex
 

Recently uploaded

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 

Recently uploaded (20)

Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 

Divide a data set into sub data sets matlab answers - matlab central