0% found this document useful (0 votes)
99 views2 pages

CSE 330 Set A Quiz 1: Input N 3 Output

This document contains 4 questions for a CSE 330 quiz set A. Question 1 asks to write a function that takes an input n and outputs a star pyramid of that height. Question 2 asks to graphically solve a 4th order polynomial using MATLAB and identify the real roots. Question 3 asks to write a MATLAB file to compute the variance of an array and square the result. Question 4 asks to write a MATLAB file that takes input, prints "yes" if the number is not a multiple of 3 or 5, and prints "no" otherwise.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
99 views2 pages

CSE 330 Set A Quiz 1: Input N 3 Output

This document contains 4 questions for a CSE 330 quiz set A. Question 1 asks to write a function that takes an input n and outputs a star pyramid of that height. Question 2 asks to graphically solve a 4th order polynomial using MATLAB and identify the real roots. Question 3 asks to write a MATLAB file to compute the variance of an array and square the result. Question 4 asks to write a MATLAB file that takes input, prints "yes" if the number is not a multiple of 3 or 5, and prints "no" otherwise.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

CSE 330 

Set A 
Quiz 1 
 
Question 1 : 
 
Use loop to build up the star pyramid. Use function to take the input. 
For example: 
Input n = 3 
 
Output: 
 

    *     
  *    *   
*    *    * 
 
 
 
Question 2: 
 
Write a Matlab code to graphically solve the following fourth order 
polynomial. 
 
 
Y =  X 2    +  X    −  12  
 
Take range of X = [­5  5]  with step size of 0.01 
From the plot, identify the real roots. 
 
 
Question 3: 
Write a M file to compute the square of the variance of the array  
A = [­2 4 ­6 0 2 8 9]. Formula for variance is given by 

 
where N= number of elements in the array 
           x ̅
   =average of the array 
 
 
Question 4: 
Write a M file to take a input and print “yes” if the number is multiple of 
neither 3 nor 5. Otherwise print “No”. 
 
 
 
 

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy