Question

I have a celll u(5,1) that looks like : u{​​​​​1,1}​​​​​=''ART1/TEACH'' u{​​​​​2,1}​​​​​=''H0ME/SHOW'' I want to remove the...

I have a celll u(5,1) that looks like :

u{​​​​​1,1}​​​​​=''ART1/TEACH''

u{​​​​​2,1}​​​​​=''H0ME/SHOW''

I want to remove the first 5 characters from each of these strings so that in MATLAB:

u{​​​​​1,1}​​​​​=''TEACH''

u{​​​​​2,1}​​​​​=''SHOW''

How can I do it?

Homework Answers

Answer #1

Here is the code

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


u ={"ART1/TEACH";"H0ME/SHOW123";"ART2/TEACHES";"H0ME/SHOW12";"ART4/TEACHER"};
for i = 1: length(u)
s = u{i,1};
u{i,1} = s(6:length(u{i,1})); % slice the string from position 5 to last index and store at the same index
end

% display all the string
for i = 1: length(u)
s = u{i,1};
disp(u{i,1});
end

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

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
i have a cell u(38,1) each row has string looking like this : for example u{​​​​​1,1}​​​​​...
i have a cell u(38,1) each row has string looking like this : for example u{​​​​​1,1}​​​​​ = ''198823 765389 white'' u{​​​​​2,1}​​​​​ = ''198426 725312 black'' I want the cell u to be divided in 3 colomns such as u{​​​​​1,1}​​​​​ = ''198823'' u{​​​​​1,2}​​​​​= ''765389'' u{​​​​​1,3}​​​​​=''white'' u{​​​​​2,1}​​​​​ = ''198426'' u{​​​​​2,1}​​​​​= ''725312'' u{​​​​​2,3}​​​​​=''black'' so basically I want my u(38,1) to become u(38,3) I have tried strplit, but it seems like it won't work with a cell, strplit(u,',') %doesn't work' strplit(u{​​​​​1,1}​​​​​,',') %works on the...
Let's say we have a pseudo-random number U = 0.128. I want to use this U...
Let's say we have a pseudo-random number U = 0.128. I want to use this U to generate an Exponential (λ = 1/3) random variate. How do I do this?
Let's say we have a pseudo-random number U = 0.334. I want to use this U...
Let's say we have a pseudo-random number U = 0.334. I want to use this U to generate an Exponential (λ = 1/4) random variate. How do I do this?  
hi , i have a question that im confusing about NMR, so if i discover my...
hi , i have a question that im confusing about NMR, so if i discover my substance along the line of CxHyOz then how do i know whether it is (CxHyOz)1 or (CxHyOz)2~x ? I have a lab about NMR and IR, can anyone give me a techinque to analyze the chart ? Cause it looks so ugly. ( just some guidance, i want to do it myself first )
Part I – Absorption and Reflection “Hey Ben, this looks like a nice place to have...
Part I – Absorption and Reflection “Hey Ben, this looks like a nice place to have our lunch.” “I guess so Abbie, but anywhere would be a good place to have lunch on such a perfect day.” “fte fall colors are just stunning. The trees didn’t turn these colors when we lived in Texas.” “Not only that,” agreed Ben, “but when we lived in Corpus Christi, Texas, we didn’t have anything that you could call fall or winter. fte trees...
i have 1052 data set i want to divide the data for validation into two groups...
i have 1052 data set i want to divide the data for validation into two groups 30% and 70 % in SPSS i asked the question before twice and you told me that to copy the 70 % then the remaining is 30 % i still can not do this because i have the 70 % from filter but i cant extract the remaining 30% ,what is the clear steps to divide into tow groups of data (the fast way...
Life Planning Using TVM: Please show how you obtained the answer, so I can have a...
Life Planning Using TVM: Please show how you obtained the answer, so I can have a better understanding. 1. You want to buy a $250,000 house 5 years from now. If you have no money to begin with, how much do you need to save at the end of each year to have 20% of the$250,000 purchase price? You plan to invest your savings with your broker who will allocate it into various asset classes. You hope to earn 8%...
Now I have 50 different bottles of water and I want to give it away (1)...
Now I have 50 different bottles of water and I want to give it away (1) If they want to give all of them away to 5 friends so that each friend gets the same number of water, how many ways are there to do this? (2) What if instead they keep 5 water, give 10 to a family member, and then distribute the remaining water equally among their 5 friends?
Problem 2: I want to create a bouquet of flowers consisting of 7 flowers. I have...
Problem 2: I want to create a bouquet of flowers consisting of 7 flowers. I have 10 roses, 8 tulips, 3 daisies and 6 lilies to choose from. You should set up but do not need to compute the answer. How many different bouquets can I make? How many different bouquets can I make that consist of 3 roses and 4 lilies? How many different bouquets can I make that consist of exactly 5 roses? How many different bouquets can...
So I would like to multiply a first digit by 2. I have to randomize either...
So I would like to multiply a first digit by 2. I have to randomize either 51-55 but multiply that first digit by 2 whichever the number may come out to be. I also need to keep the string. I need this to be in JAVA but so far Here is my code: import java.util.Random; public class Randoms {    public static void main(String[] args) {    Random rng = new Random();    String x;    int max = 55;...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT