MATLAB CODE---
FUNCTION FILE.....
function Q=myTrigFunction(M)
[m,n]=size(M);
Q=ones(m,n);
for i=1:m
for j=1:n
if(mod((M(i,j)),2)==1)
Q(i,j)=sin(pi/M(i,j))+1;
else
Q(i,j)=cos(pi/M(i,j))-1;
end
end
end
fprintf('R=\n');
disp(Q);
end
SCRIPT FILE.....
clc;
clear all;
close all;
A=input('ENTER THE MATRIX A=');
R=myTrigFunction(A);
Programming Langauge: MATLAB Write a function with the header: function Q = myTrigFunction (M) which takes...
The
question is attached in following two photos. Please use Matlab if
you exactly know how to do it. Thank you.
Linorm.m Create a function Linorm which takes one argument, M a square matrix and computes the LI-norm of the matrix. This is a number associated to each square matrix M, denoted lIMll, as follows. For each column of the matrix we add together the absolute values of the entries in that column, and we then take the maximum of...
1. Write a MATLAB function that takes a matrix, a row number and
a scalar as
arguments and multiplies each element of the row of the matrix by
the scalar returning the
updated matrix.
2. Write a MATLAB function that takes a matrix, two row numbers and
a scalar as
arguments and returns a matrix with a linear combination of the
rows. For example, if the rows
passed to the function were i and j and the scalar was m,...
CODE MUST BE WRITTEN IN SWIFT programming language Write a function that takes in two positive integers and prints every prime number between (and including) them Sample Input: prime(from: 0, to: 100) Sample Output: [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]
Use the create_matrix function from the tutorial file, along with a function a (i, j) (which you will have to create) to produce the following 17 × 17 matrix. Then find its determinant. 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 6 6 1 1 1 1 1 1 1 1 1 1 1...
Why is my multiplication wrong when i do a matrix of 3 x 5 and 2
x 2?
code below
import java.util.*;
public class matrix {
public static
void main(String[] args) {
int m, n, i, j;
Random rand = new Random();
Scanner scan = new
Scanner(System.in);
System.out.print("enter how many
rows:");
m = scan.nextInt();
System.out.print("enter how many
columns:");
n=scan.nextInt();
int matrix_1[][] = new
int[m][n]; //Initialize matrixes
int maritx_2[][] = new
int[m][n];
int matrix_add[][] = new
int[m][n];
int matrix_mul[][] = new...
USE PYTHON PLEASE
Write a function called is prime which takes a single integer argument and returns a single Boolean value representing whether the given argument is prime (True) or not (False). After writing the function, test it by using a loop to print out all the prime numbers from 1-100. To check your results, the prime numbers from 1-100 are: 2, 3, 5, 7, 11. 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67,...
Project in matlab. I have the correct ak value but not the
correct ao value. My code is attached below also
2. Determine and plot the magnitude and phase spectrum of the Fourier series coefficients a, that is, plot ja, I as a function of discrete frequencies Jok and La, as a function of discrete frequencies fok 03 025 蓋0.2 0.15 0.1 o o5 ·10-8-6 4610 phase -2 -2 8- t= 0: .01:4; 9- to = 4; 10- fo =1/4;...
== Programming Assignment == For this assignment you will write a program that controls a set of rovers and sends them commands to navigate on the Martian surface where they take samples. Each rover performs several missions and each mission follows the same sequence: deploy, perform one or more moves and scans, then return to base and report the results. While on a mission each rover needs to remember the scan results, in the same order as they were taken,...
느 - K L M N O Р Q R S B с D E F G H 4 A sample of households provided the following information about their Per Capita Income. 5 Use Excel to construct a percent frequency distribution table and graph. 6 Provide an appropriate label for each of the horizontal and vertical axes. 7 Make your first class "30,000-34,999" 8 Place the frequency distribution table and histogram within the highlighted box below. 9 Per Capita 10...
Consider the Java program below to sort an array A in an ascending order. M, N, and K are positive integers, and A is an array of N nonnegative integers where 0 < A[i] < M for all i e {0,..., N -1}. In this program, list is a class of an integer list with the following methods. 1st.size(): returns the number of elements in the list lst 1st.get(i): returns the element at the i-th position in the list lst...