How to remove second digit of first a column

1 Ansicht (letzte 30 Tage)
Vishal Sharma
Vishal Sharma am 24 Jan. 2017
Bearbeitet: James Tursa am 24 Jan. 2017
I have one matrix A = [21 2; 34 3; 13 4] I want to remove first digit of first column, so that result shall be A= [1 2;4 3; 3 4]
  1 Kommentar
Jan
Jan am 24 Jan. 2017
Bearbeitet: Jan am 24 Jan. 2017
What do you want for the inputs 123 and -2? Do you really want to remove the first digit, or to obtain the second digit, or to keep the digit smaller than 10?

Melden Sie sich an, um zu kommentieren.

Antworten (2)

James Tursa
James Tursa am 24 Jan. 2017
Bearbeitet: James Tursa am 24 Jan. 2017
To retain the 1st digit for the numbers shown:
result = [floor(A(:,1)/10) A(:,2)];
To retain the 2nd digit for the numbers shown:
result = [mod(A(:,1),10) A(:,2)];
If numbers can be > 99 or negative, then you will have to let us know what you want for output.
  2 Kommentare
Vishal Sharma
Vishal Sharma am 24 Jan. 2017
I want to retain second digit not the first one ....
Image Analyst
Image Analyst am 24 Jan. 2017
Why do you need this quirky, unusual thing?

Melden Sie sich an, um zu kommentieren.


Stephen23
Stephen23 am 24 Jan. 2017
>> rem(A,10)
ans =
1 2
4 3
3 4

Kategorien

Mehr zu Fourier Analysis and Filtering finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by