Matlab coding assistance. Having some difficulty please help! thank you so much in advance!
%% Task 9
% use logical tests to locate and update subsets of a matrix
% Step 1: Create vec, a row vector of 5 random integers on the closed interval [-10,10].
% Step 2: Use a logical mask to count the number of positive values (code provided is already sufficient)
mask = vec > 0
count = sum(mask)
% Step 3: Use the find function to locate where the positive values are in
% the vector (code provided is already sufficient)
inds = find(vec > 0)
% Step 4: Display only the positive values in vec (index into vec using the inds variable)
% Step 5: Negate the positive values by indexing into
% vec using the mask variable, and multiplying all those values by -1
.
%% Task 10
% Matrix multiplication
% Step 1:
%a) Define matrices A, B, and C as shown in Ex 42
% b) compute the expressions 3*A and A+3
% c) compute the expressions A*C, C*A, C*C and C.*C
% comment out any expression that does not compute successfully
% c) compute the expressions A*A and A.*A
% (Be sure you understand the difference between these two operations.
% Step 2:
% a) define matrices A, B and C as shown in Ex 43
% b) compute the matrix operations A*A,B*B and C*C
% comment out any expression that does not compute successfully
% c) use the size function to display the dimensions of B and C
% then compute the matrix operations B*C and C*B
% comment out any expression that does not compute successfully
% (Be sure you understand how to predict which the matrix products will
% compute, along with the dimensions of the result.)
>>r = randi([10 50],-10,10); //a row vector of 5 random integers on the closed interval [-10,10]
>>vec=r;
Display only the positive values in vec (index into vec using the inds variable)
len=length(vec);
for inds=1:len;
if vec(inds)>=0
P(inds)=vec(inds);
end
disp(P)
Matlab coding assistance. Having some difficulty please help! thank you so much in advance! %% Task...
I NEED HELP WITH THIS 2 PROBLEMS PLEASE! THANK YOU SO MUCH
Given below is a partially completed C program, which you will use as a start to complete the given tasks. #define SIZE 9 #include <stdio.h> int compareAndCount (int[], int[]); double averageDifference (int[], int[]); void main() { } int compareAndCount(int arr1[SIZE], int arr2[SIZE]) { int count = @; for (int i = 0; i < SIZE; i++) { if (arr1[1] > arr2[i]) count++; return count; } Task 1: (10...
i've been having a hard time, i appreciate your help, thank
you so much in advance! can you please circle the answers thank
you
1
2
3
(1 point) It is necessary for an automobile producer to estimate the number of miles per gallon achieved by its cars. Suppose that the sample mean for a random sample of 150 cars is 29.1 miles and assume the standard deviation is 2.4 miles. Now suppose the car producer wants to test the...
Please help answer this question? Please note that no dimensions
were provided.
Thank you so much
04-BS-15 Engineering Graphics & Design Process December 2018 QUESTION 1 (50 MARKS) For the part shown below, Sketch an appropriate set of orthographic views, using third-angle projection. (10 marks) Fully dimension the sketch in part a) using professional standards. Use "xx" in place of numerical values in the dimensions. (10 marks) Describe and sketch an appropriate sequence of feature-based solid modelling operations that could...
Please help me answer this question? Please note that no
dimensions were given. Thank you so much
04-BS-15 Engineering Graphics & Design Process May 2012 QUESTION 1 For the part shown below, Sketch an appropriate set of orthographic views, using third-angle projection. (10 marks) values in the dimensions. (10 marks) could be used to create this geometry using parametric, feature-based solid modelling CAD a) b) Fully dimension the sketch in part a) using professional standards. Use "xx' in place of...
Need help with this question on matlab.
Show code please!
Salmon_dat.csv
272395
286156
391573
461443
401998
313120
240763
297488
446152
480276
420555
277697
357375
331788
420879
332479
320947
359853
300917
403286
416419
345028
256049
281980
286625
278560
344422
317956
219688
259337
208197
189419
272884
360673
248860
306981
401711
867728
870035
921314
846026
570413
493708
275954
518942
480284
809799
677171
589937
1129664
1152642
Exercise 1: Salmon Runs Download the file salmon-dat.csv included with the homework. This file con- tains the annual...
Hey guys, I need some help solving this problem. thank
you very much in advance!
Pontfolio Optimization Task 4 Suppose the shares of two different companies give you the same return on average. Does it make sense to distribute your money and buy some shares of each company? Or would it be better to invest all the money into only a single company? Common sense says: "distribute" Why? Let's see... What at all could we gain if the return is...
For this project, each part will be in its oun matlab script. You will be uploading a total 3 m files. Be sure to make your variable names descriptive, and add comments regularly to describe what your code is doing and hou your code aligns with the assignment 1 Iterative Methods: Conjugate Gradient In most software applications, row reduction is rarely used to solve a linear system Ar-b instead, an iterative algorithm like the one presented below is used. 1.1...
PLEASE help me with the answers for b, c, and d! Especially d (you
do not have to create a histogram for me)! Thank you so much!!!
4) You've been elected to the board, and to gather some information, you send out a survey to all residents about how often they think the board should meet each quarter. You get the following 60 responses: 4 2 3 2 443 3 344 4 4 2 3 2 2 4 44 34...
Your task is to develop a large hexadecimal integer calculator that works with hexadecimal integers of up to 100 digits (plus a sign). The calculator has a simple user interface, and 10 \variables" (n0, n1, ..., n9) into which hexadecimal integers can be stored. For example a session with your calculator might look like: mac: ./assmt1 > n0=0x2147483647 > n0+0x3 > n0? 0x214748364A > n1=0x1000000000000000000 > n1+n0 > n1? 0x100000000214748364A > n0? 0x214748364A > exit mac: Note: \mac: " is...
Consider a cylindrical capacitor like that shown in Fig. 24.6. Let d = rb − ra be the spacing between the inner and outer conductors. (a) Let the radii of the two conductors be only slightly different, so that d << ra. Show that the result derived in Example 24.4 (Section 24.1) for the capacitance of a cylindrical capacitor then reduces to Eq. (24.2), the equation for the capacitance of a parallel-plate capacitor, with A being the surface area of...