Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Calculate the product of 1 through N Write a function named myFunction(N) which accepts an integer N as the input argument and returns the product

image text in transcribed

image text in transcribed

Calculate the product of 1 through N Write a function named myFunction(N) which accepts an integer N as the input argument and returns the product 1*2*3*...*N as output Note, use for-loop to finish this task, instead of the built-in function factorial() if you found it Function Save 1 function y = my Function(x) p=1; %for i= 2 3 4 5 %end 6 y=p; 7 end nested for-loop, function on an input matrix Write a function named myFunction(m) which accepts an input matrix m finds how many rows and how many columns in there (try out how the built-in size() work and use it here) uses nested for-loop to operate on each element of m if it is greater than 5, square root it; otherwise, do nothing RETURN the modified m

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_2

Step: 3

blur-text-image_3

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

Information Modeling And Relational Databases

Authors: Terry Halpin, Tony Morgan

2nd Edition

0123735688, 978-0123735683

More Books

Students also viewed these Databases questions