Effacer les filtres
Effacer les filtres

subtract and save in a file and then plot

2 vues (au cours des 30 derniers jours)
aditi
aditi le 13 Avr 2014
Réponse apportée : dpb le 13 Avr 2014
I have a file with 5 columns and 100 rows i.e like:
1 2 3 4 5
6 7 8 9 0
2 5 4 9 2
7 4 9 3 5 .....
and so on. I have to subtract 10 from 5th column then add the resultant to 4rth column and then make a new file with 1st, 2nd, 3rd & 4rth column of above file as it is plus a new column containing result of above i.e the one with the values we got after adding resultant to 4rth column.
plz help me with the program

Réponses (1)

dpb
dpb le 13 Avr 2014
b=[a(:,1:4) a(:,5)-10+a(:,4)];
Read the "Getting Started" section in the Matlab documentation and work thru the examples on array handling w/ colon and so on to get a feel for the syntax.

Catégories

En savoir plus sur Entering Commands dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by