Hello, I have some trouble with this questin and in need of help. Please be as c
ID: 3604257 • Letter: H
Question
Hello,
I have some trouble with this questin and in need of help.
Please be as clear as possible.
Thank you.
hw4.pat-Adobe Acrobat Reader DC File Edit View Window Help 0 hwé.pdf Sign In Home Tools 125% Excrcisc 1: Salmon Runs Download the filc salmon dat.csv included with the homcwork. This file con tains the annual Chinook salmon counts taken at Bonneville on thc Columbia river from the years 1938 to 2014 (uwu.cbr.washington.edu). Yon can load this ile into MATLAR using >>load salmon data.csv. Do not upload this file to Scorelator, your code will be tested using the counts for another species of salmon Lxport PD Create PDF Edit PDF Comment Combine Files (a) You should begin by creating a time vector>t (1:length(salmon data)).' A and plotting thc salmon counts against the year in which thoy wcre taken (plotting usually helps you get a better understanding of the data), but make sure to comment out the plot before submitting. Note that we have let 1938 be represented by year 1 (making 2014 year 77), continue with this convention in the rest of the problem. In the video lectures, you learned that the following matrix equations could be used to determine the coellicients of a linear best-fit: Adobe Acrobat Pro DC Cconbine v or iles singlr PDE Learn more O Organize Pages SR ill & Sign where18 lhe-1h illdex of lhe salmon coun! dala. The solu!ion provides A and B such that y A +B is the RMS best-fi line. Compute the Q, R, and P matrices and concatenate them in that order to form a 2× 4 matrix. Save the rcsult in A1.dat. You can confirm that your A and B arc correct by finding a first order fit using polyfit. Send for Signature … Send & Track (b) Use polyfit lo find the best-fit polynois of order 2, 5, ad 8, and save Store and sharc files in the Dexcurment Cloud these cocfficients in A2.dat, A3.dat, and A4.dat, respectively. You should plot cach of thesc best-fits, but make sure to comment out the plot before submitting Learn Mar 3:17 AM O lype here to search ENG 10/28/2017 ^Explanation / Answer
#include <iostream>
#include <cstdlib>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
class RegisterOp
{
private:
vector<char> reg;
public:
int size;
RegisterOp(int si);
int insert_register(string s1);
int right_shift_op(int num_rs, char vvalue);
int left_shift_op(int num_ls, char vvalue);
int getregistersizeValue();
void setregistersizeValue(int val);
int print_regis();
};
RegisterOp::RegisterOp(int s1)
{
size = s1;
}
int RegisterOp::insert_register(string s1)
{
for (int i = 0; i < size; i++)
{
reg.push_back(s1[i]);
}
reverse(reg.begin(), reg.end());
return 0;
}
int RegisterOp::right_shift_op(int num_rs, char vvalue)
{
reg.erase(reg.begin(), reg.begin()+num_rs);
for (int i = 0; i < num_rs; i++)
{
reg.push_back(vvalue);
}
return 0;
}
int RegisterOp::left_shift_op(int num_ls, char vvalue)
{
reg.erase(reg.end()-num_ls, reg.end());
for (int i = 0; i < num_ls; i++)
{
reg.insert(reg.begin(), vvalue);
}
return 0;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.