Question
MATLAB you are given a string named news. Count how many times President Trump's name shows up in the news, assign to variable number_Trump. Replace
MATLAB
you are given a string named news. Count how many times President Trump's name shows up in the news, assign to variable number_Trump. Replace "Trump" in the strig with "TRUMP", assign to a string news_switch, and display.
p1="The White House will formally reissue nationwide coronavirus guidelines today after President Trump faced with dire models showing up to 200,000 American deaths and polls indicating support for social distancing and calamitous scenes at New York hospitals determined another 30 days were necessary to avert disaster.";
p2="Not all of Trump's advisers support the decision, and some have privately questioned the models his health advisers used to convince him the distancing efforts were necessary, multiple people familiar with the matter said.";
p3="Trump faced intense pressure from business leaders and some conservative economists to reopen some parts of the country before ultimately deciding against it.";
p4="There has been internal debate over whether to ease the social distancing efforts. Some aides recommended the President only extend them another 15 days, but health advisers argued a month was necessary, people familiar with the discussions said. Trump told aides it would be better to ease the guidelines earlier than expected rather than have to extend them again.";
p5="The guidelines are expected to last until April 30.";
news=p1+" "+p2+" "+p3+" "+p4+" "+p5; % news is a single string
number_Trump=count? % check today's slides
news_switch= % check today's slides
fprintf("President Trump shows up in the news %d times. ", number_Trump);
display(news_switch);
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started