Thinking Like an Engineer: An Active Learning Approach (3rd Edition)
Thinking Like an Engineer: An Active Learning Approach (3rd Edition)
3rd Edition
ISBN: 9780133593211
Author: Elizabeth A. Stephan, David R. Bowman, William J. Park, Benjamin L. Sill, Matthew W. Ohland
Publisher: PEARSON
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 16, Problem 7ICA

For each of the following problems, write a single MATLAB statement that will accomplish the stated purpose. Assume a text string TS1 has already been defined.

  1. a. Create a vector LetLoc with the same number of elements as TS1. For each element of TS1 that is alphabetic, the corresponding element of LetLoc should equal 1. All other elements of LetLoc should be 0. Example: TS1='%@3Gb6* returns LetLoc=[0 o o l l 0]
  2. b. Create a vector Alphas that has the numeric positions of all alphabetic characters in TS1. Example: TS1 ='%@3Gb6' returns Aiphas=[4 5]
  3. c. Place the numeric index of the first alphabetic character in tsi into Aiphai. Example: TS1 ='%@3Gb6' returns Aiphai=4
  4. d. Place the last alphabetic character in TS1 into LastLetter. Example: TS1 ='%@3Gb6' LastLetter=b
  5. e. Find all occurrences of the string @3G in string tsi and place the locations of the first character of each such substring (@) into str3G. Example: TS1='%@3Gb6kl@3G9@33G’ returns Str3G=[2 9]
Blurred answer
Students have asked these similar questions
I need help with a MATLAB code. I need to find two values of n, one that is positive and one that is negative, that will give all negative real roots. Can you help me find them?   function [r] = find_roots(n)     % Define constants    I = 400;    J = 150;    x = (J/I) - 1;    y = n - 1;    Q = y + x*(y-1);     % Define the coefficients of the quadratic equation    coefficients = [1, 0, (3*x+Q^2+1), 0, (3*x*Q+Q^2)];     % Find the roots    r = roots(coefficients);      end
please write a matlab code
The Pascal triangle can be displayed as elements in a lower-triangular matrix as shown on the right. Write a MATLAB program that creates a n × n matrix that displays n rows of Pascal’s triangle. Use the program to create 4 and 7 rows Pascal’s triangles. (One way to calculate the value of the elements in the lower portion of the matrix is
Knowledge Booster
Background pattern image
Mechanical Engineering
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, mechanical-engineering and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Elements Of Electromagnetics
Mechanical Engineering
ISBN:9780190698614
Author:Sadiku, Matthew N. O.
Publisher:Oxford University Press
Text book image
Mechanics of Materials (10th Edition)
Mechanical Engineering
ISBN:9780134319650
Author:Russell C. Hibbeler
Publisher:PEARSON
Text book image
Thermodynamics: An Engineering Approach
Mechanical Engineering
ISBN:9781259822674
Author:Yunus A. Cengel Dr., Michael A. Boles
Publisher:McGraw-Hill Education
Text book image
Control Systems Engineering
Mechanical Engineering
ISBN:9781118170519
Author:Norman S. Nise
Publisher:WILEY
Text book image
Mechanics of Materials (MindTap Course List)
Mechanical Engineering
ISBN:9781337093347
Author:Barry J. Goodno, James M. Gere
Publisher:Cengage Learning
Text book image
Engineering Mechanics: Statics
Mechanical Engineering
ISBN:9781118807330
Author:James L. Meriam, L. G. Kraige, J. N. Bolton
Publisher:WILEY
Thermodynamics - Chapter 3 - Pure substances; Author: Engineering Deciphered;https://www.youtube.com/watch?v=bTMQtj13yu8;License: Standard YouTube License, CC-BY