generating command
t=0;Y=[]; for c=1:3 t=10*t+1;Y=[Y t]; end
and after it
p1=[Y;2*Y;3*Y]
![>> t=0; Y=[]; for c=1:3 t=10*t+1;Y=[Y t]; end >> pl=[Y;2*Y;3*Y] pl = 1 11 111 2 3 22 33 222 333 w »|](http://img.homeworklib.com/questions/71648270-c6eb-11eb-b2cc-0b2095cc6171.png?x-oss-process=image/resize,w_560)
For the following array in the image below, create the MATLAB command that would generate it...
Please answer both 11 & 12 for matlab program
Create a cell array variable that would store for a student his or her name university id number, and GPA. Print this information. Create a structure variable that would store for a student his or her name. University id number, and GPA. Print this information.
Write a MATLAB code to generate an array of 100 random integers between 1 and 10 using the command “randi”. Using “if” statement, impose the condition that if a number in the array is greater than 5, the number is modified as, number = number – 11. Find the sum of the array and store it. Repeat this exercise for 10, 1000 and 100000 trials and plot the following: (a) Sums obtained vs trails number (b) Histogram of the sum...
Exercise 1: Use Matlab command to obtain the following a) Extract the fourth row of the matrix generated by magic(6) b) Show the results of 'x' multiply by 'y' and 'y' divides by 'x'. Given x = [0:0.1:1.1] and y=[10:21] c) Generate random matrix 'r' of size 4 by 5 with number varying between -8 and 9 Exercise 2: Use MATLAB commands to get exactly as the figure shown below x=pi/2:pi/10:2*pi; y=sin(x); z=cos (x);
write a Matlab program ( solve the three questions). please use array and create your own function to check primality Question 1 : [10 points) Write a MATLAB program that will store all the first 1000 prime numbers in an array variable named arr_of_primes. Please note that a prime number is a positive integer that is bigger than or equal to 2 which is divisible only by 1 and itself. Examples of the first 8 primes are: 2, 3, 5,...
What would be the results of the following code? Create array1 ← [33, 88, 11, 44, 99, 55] value ← array1[0] FOR each value in array1 IF(array1[i] < value) THEN value ← array1[i] ENDIF ENDFOR Question 7 options: A) Value contains the lowest value in array1. B) Value contains the highest value in array1. C) Value contains the sum of all the values in array1. D) Value contains the average of the values in array1. Question 8 (1 point) What...
1. Write a C or C++ program A6p2.c[pp] that accepts one command line argument which is an integer n between 2 and 4 inclusive. Generate 60 random integers between 1 and 39 inclusive and store them in a 5 by 12 two dimensional integer array (e.g.,int a[5][12];). Use pthread to create n threads to convert all 60 array elements modulo 11 (i.e. take the remainder after division by 11) in place. You should divide this update task among the n threads as evenly as possible. Print the array both before and after...
Create 4 arrays: a 1-D array to store the students’ id, 1-D array to store the students’ names, a parallel 2-D array to store the test scores, and a parallel 1-D array to store letter grades. Read data into the 3 arrays from the file data121.txt. If the file is not found, the program needs to terminate with this error, “Data file not found.” Calculate and store a letter grade into a 1-D array based on the total score, sum...
Create a program that presents a menu with these options: Add employee Print Employee Report Quit Read the initial employee list from a text file and store the employee information into a DICTIONARY called empDict. Key empID, value is a LIST that contains name, payrate, and hours. The text file will be structured as shown below, where each line contains the employee id, employee name, payrate and hours. Each entry on the line is separated by a comma and a...
Question 8) Suppose a program is supposed to merge two files in the following manner: write two lines from the first file, write two lines from the second file, and repeat the process until all of the lines have been written to the new merged file. For example suppose we have the following two input files: File1.txt File2.txt AAA BBB CCC DDD 000 111 222 333 Then the merged output file would be: File3.txt AAA BBB 000 111 CCC DDD...
Using Swift playground and / or the command line for macOS (open Xcode, create a new Xcode project, macOS, command line tool), practice the following exercises: Exercise: Swift Variables Declare 2 variables/constants with some random values and any name of your choice Considering these 2 variables, one as a value of PI and other as a radius of circle, find the area of circle Print the area of circle Declare a string variable explicitly with value “Northeastern”. Declare a string...