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
oftware that is free and whose code can be accessed and potentially modified by anyone is referred to as _____. shared source fi
ad-work [718]

Answer:

open source software

Explanation:

A software that is free and whose code can be accessed and potentially modified by anyone is referred to as an open source software. The license used by the developer of an open source software grants all users the permission to use, distribute and modify the software at any time.

Some examples of an open source software are Firefox, gimp, OpenOffice etc.

8 0
3 years ago
( Game Design) The companies who get video games out to consumers are called:
Bad White [126]

Answer:

They are called video game publishers

Explanation:

A video game publisher is responsible for financing a video game’s development, marketing, and release of the game to the consumers. Basically, they are the ones who manage the business end of the gaming field. If the video game company is well established, the publishers of that company will be the ones to distribute while some smaller companies will hire distribution companies to distribute the games for them

3 0
3 years ago
Need help ASAPppppppppp
Darina [25.2K]

Answer:

Below picture should give you an indication. On different PC cases, the position of the connectors can be different, so you have to look at the shape.

5 0
3 years ago
Differentiate between tabular and column form layout​
NeTakaya

In tabular form the data is displayed in a table layout following a continuous series of records. In this almost all the records are displayed in a single layout. While in columnar form the data is displayed one record at a time.

6 0
3 years ago
Why is primary storage important
zepelin [54]

Answer:

What is primary storage?

A primary storage device is a medium that holds a memory for short periods of time while a computer is running. Although it has a much lower access time and faster performance, it is also about two orders of magnitude more costly than secondary storage.

A primary storage device may also be referred to as internal memory, main memory, main storage, and primary memory.

Why is primary storage important?

Primary storage provides fast access to the CPU, which allows active programs to deliver optimal performance to the end-user. Speed and usefulness aside, the fact that the loss of power means the loss of data makes RAM a short-term storage solution. In fact, it’s lack of long-term viability is the reason it makes sense to save your progress when working in one program or another.

3 0
3 years ago
Other questions:
  • A dedicated website was created where fans could post photos of the pages from decoded that they found. in the communication pro
    11·2 answers
  • If a CPU receives theinstruction to multiply the byte-sized values $12 and $3E, thisaction will take place in the ______________
    13·1 answer
  • True or false? LearnSmart (the "smart flash card assignments") really gets your competitive spirit in gear by allowing you to se
    8·1 answer
  • It is advised to always have discretion with leaders. Explain in general terms what information security policies can and cannot
    12·1 answer
  • What application can be used to set windows 8 to boot into safe mode while still in windows?
    15·1 answer
  • What is referred to by the phrase “Web 2.0”?
    11·1 answer
  • To be fluent in computer language you must learn 8000 __________? (9 letter word)
    5·1 answer
  • Anyone here codes? <br> C++, C#, Lua? Anything?
    15·2 answers
  • What are building blocks? Select three options.
    14·1 answer
  • A service _ consists of overhead wires and devices that connect the power company power lines to a residence.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!