Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please write out the algorithm steps! Prob 1. 30pts Develop an algorithm that accepts a numerical vector X as input and outputs second smallest number.
Please write out the algorithm steps!
Prob 1. 30pts Develop an algorithm that accepts a numerical vector X as input and outputs second smallest number. You are only allowed to use the Matlab built-in function length() to determine the length of the vector. Memory trace your algorithm using the following two vectors: (29 25 -12 29-17 4 13] and [6.29 8.12 -7.46 8.27 2.65 -8.05 -4.43 0.94]. Prob 2. 30pts Develop an algorithm that accepts a positive integer number as input and determine whether this number is prime. Output an appropriate message depending on the outcome. You are allowed to use the built-in function rem() that calculate a remainder. Memory trace your algorithm with 11 and 25 separatelyStep 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