1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
kirill115 [55]
3 years ago
14

Given an input array of strings (characters) s, pick out the second column of data and convert it into a column vector of data.

Missing data will be indicated by the number 9999. If you encounter missing data, you should set it to the average of the immediately neighboring values. (This is a bit simpler than using `interp1`.)
If the input array is s = [ 'A' '0096' ; 'B' '0114' ; 'C' '9999' ; 'D' '0105' ; 'E' '0112' ]; then the output variable `t` is the following column vector. t = [96 114 109.5 105 112]';
Compose a function read_and_interp which accepts an array in the above format and returns the data converted as specified. You may find the conversion function `str2num` to be useful.
(Using MATLAB Syntax only)
Computers and Technology
1 answer:
hodyreva [135]3 years ago
7 0

Answer:

Consider the following code.

Explanation:

save the following code in read_and_interp.m

 

function X = read_and_interp(s)

[m, n] = size(s);

X = zeros(m, 1);

for i = 1:m

if(str2num(s(i, 2:5)) == 9999)

% compute value based on previous and next entries in s array

% s(i, 2:5) retrieves columns 2-5 in ith row

X(i,1) = (str2num(s(i-1 ,2:5)) + str2num(s(i+1,2:5)))/2;

else

X(i,1) = str2num(s(i,2:5));

end

end

end

======================

Now you can use teh function as shown below

s = [ 'A' '0096' ; 'B' '0114' ; 'C' '9999' ; 'D' '0105' ; 'E' '0112' ];

read_and_interp(s)

output

ans =

96.000

114.000

109.500

105.000

112.000

You might be interested in
Who is the primary audience for demonstrations of game prototypes made by the developer?
padilas [110]

Answer:

the tester

Explanation:

When a video game is playable the first audience to test these prototypes are the tester, these people have to test all the game, and they have say all the information about errors, issues, bugs, and any difficulty to resolve these problems in a final video game's version, in this way the complete game arrives to the final audience.

5 0
2 years ago
Which of the following best describes the impact of Creative Commons?
Pachacha [2.7K]

Answer:

it’s just a screenie hope it helps

8 0
2 years ago
Fuction table of JK-Flip flop?
vivado [14]

Answer:

Explanation:

The Truth Table for the JK Function. Then the JK flip-flop is basically an SR flip flop with feedback which enables only one of its two input terminals, either SET or RESET to be active at any one time thereby eliminating the invalid condition seen previously in the SR flip flop circuit.

6 0
3 years ago
As it turns out, the scale of this chart is higher than all of these; it’s “exponential.” What does this imply for the difficult
Oksanka [162]

Answer:

no meme

Explanation:

[...]

8 0
3 years ago
why is it important for young people to start saving early as possible given the principles of interest?
hjlf
<span>Saving at a young age could be a really great investment on your future from years from now. It has several benefits like learning how to handle your money properly, investing to grow your money more and an early retirement with a lot of coins in your pocket for when you want to enjoy traveling more.</span>
5 0
3 years ago
Read 2 more answers
Other questions:
  • Do Y’all know how to view your answers to others people questions on your profile? Please answer fast
    14·1 answer
  • The network ____, the person overseeing network operations, uses a server operating system to add and remove users, computers, a
    15·1 answer
  • What will be the value of ans after the following code has been executed?
    10·2 answers
  • Gina works in an SDLC team. When Gina makes changes to a file, no one else is allowed to acess it. Which type of version control
    10·1 answer
  • Recursion is a natural use for a _____ (stack or queue)
    13·1 answer
  • What type of network is capable of delivering voice, video streams, text, and graphics between many different types of devices o
    15·1 answer
  • The process of identifying and eliminating bugs in a software program is most generally called
    5·1 answer
  • I really need this done Thank you!!
    6·1 answer
  • (PLEASE HELP)
    5·1 answer
  • Why do my airpods keep disconnecting from my laptop
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!