Answered step by step
Verified Expert Solution
Question
1 Approved Answer
We can also write a for - loop to apply a user - defined function 'checkEvent ( ) ' to each row of a matrix
We can also write a forloop to apply a userdefined function 'checkEvent to each row of a matrix object 'simulatedData' as follows:
val vectorlength nrowsimulatedData
for i in :nrowsimulatedData
vali checkEventsimulatedDatai
Which one of the following is TRUE about this approach?
Question options:
It would be computationally expensive if 'simulatedData' is big.
It will work only if 'simulatedData' has equal number of rows and columns.
It will work only if 'simulatedData' is a matrix of numerical values.
It will take a similar computational time as using the apply function but the code will be a bit bigger.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started