Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In a new cell (section) of the script you made in Problem 3, complete the follow

ID: 3842209 • Letter: I

Question

In a new cell (section) of the script you made in Problem 3, complete the following: a) write your name and section number on separate lines: use a block comment to accomplish this b) Find the signum (sign) of a = [5 -2] Use a built-in command to accomplish this, and store the result in a new array of data c) What are the prime factors of 24? Does it match what you would expect? d) ls 13 a prime number? How many prime numbers are there less than 27? e) Copy the initial x and y allocations from Problem 3 and paste them into the cell for Problem 4. Then, find the floor of x, storing the result as a variable b. Finally, find the ceiling of y, storing the result as a variable c. f) Round b to the nearest integer and call the result d; then, truncate c, and store the result as e. g) What is the numeric value of log_6(5)? h) Find the fractional form of the number 2.3 i) Find the values of f = 5!, g = 8!, and h = 15! and store the results in variables of the same names

Explanation / Answer

b)the matlab code for the signum function is given by and also the graph can be directly plotted using this code:

x = [-5 -eps(1) 0 eps(1) 5];
y = sign(x);
plot(x,y)
ylim([-2 2])
grid on

e)this code in c will provide us us the ceiling and floor for an array

f) ,i,C code to find the nearest integer for the given input

,ii,c code to find the truncate for input

#include<stdio.h>
void main()
{
float x;
int a;

printf("Enter the number for which you want to find trunc");
scanf("%f",&x);

a=(int)(x+0.5);
printf("Truncated value is %d",a);
}

g)C++ code to find log5 to base 6 by taking 5 and 6 from inputs

#include <stdio.h> /* printf */
#include <math.h> /* log */

int main ()
{
double param, base, result;
printf("Enter the value you eant to find");
scanf("%f",&param);
printf("Enter the value to which you want to find the base");
scanf("%f",&base);
result = log (param)/log(base);//log(param) to required base=log(param)to base 10/log(base) to base 10
printf ("log(%f) to base %f = %f ", param,base, result );
return 0;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote