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
11What is the definition of bandwidth? the speed at which bits travel on the network the measure of the transfer of bits across
DIA [1.3K]

Answer:the transmission capacity of an electronic communications device or system; the speed of data transfer

Explanation:

8 0
4 years ago
Software that controls a computer. an os controls how system resources are used and provides a user interface, a way of managing
nataly862011 [7]
For bad software, probably a virus/malware/ransomware kind of thing. If it is good software, probably a program that organizes your files, adjusts certain things, but do not record your files (no programs are at the top of my head, sorry).
4 0
4 years ago
Which federal legislation prohibits credit card companies from raising rates on existing balances?
Viefleur [7K]

Answer:

d

Explanation:

5 0
3 years ago
Read 2 more answers
which artists work provides visual effects to enhance the action of an animated movie , film, or video
lubasha [3.4K]

Answer:

VFX specialists can use software to perform animations plus unique effects. They mainly work on films, television shows, and or video games. This profession is normally granted full time and can also be part-time areas that may be accessible.

Explanation:

7 0
3 years ago
The IBM nine-track tapes that became the industry standard for storage for three decades had several sizes , the most common bei
sergey [27]

Answer:

5 MB.

Explanation:

1 foot = 12 inches

2400/9=266.66 feet per track

1 track excluding, remaining 8 track =2400 - 266.66 = 2133.33 feet

so, space available to store data = 2133.33 feet

now, 2133.33 feet = 25600 inches

total data that can be stored = 25600 * 1600 = 40960000 bits

= 46080000/8 = 5120000 Bytes

= 5120000/1000000 = 5.12 MB = 5 MB (approx.)

3 0
3 years ago
Other questions:
  • Perform online research and learn about the elements of a presentation program interface not discussed in the lesson. Write a sh
    9·1 answer
  • How many results are shown by default when using a Top or Rare Command?
    13·1 answer
  • In which of the following locations can you edit all of the Properties of a PowerPoint file?
    11·1 answer
  • Which of the following is a beneficial reason to extract mineral resources from the earth?
    13·2 answers
  • If Phil is putting exact phrases in quotation marks while searching for information, he's using which of the following?
    14·1 answer
  • Byron wants to use Quick Parts to insert reusable content into a company Word document. Where will he access this option? Design
    11·2 answers
  • Agile methods typically use a ______ model, which represents a series of iterations, or revisions, which are based on user feedb
    7·1 answer
  • A celebrity blogger you have followed for years advises readers to try a new beauty product. Before purchasing the product, a sa
    10·1 answer
  • The Fast as Light Shipping company charges the following rates. Weight of the item being sent Rate per 100 Miles shipped 2kg or
    13·1 answer
  • if you want to build a smart-glove that responds based on the direction and speed a user moves their hand, what sensor should yo
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!