Hi,
I would like to generate the following array using matlab: v=4/(1-4),14/(1-14),24/(1-24),...,194/(1-194)
Can somebody help?

 Réponse acceptée

Stephen23
Stephen23 le 3 Fév 2019

1 vote

In two simple steps:
>> V = 4:10:194 % 1st step
V =
4 14 24 34 44 54 64 74 84 94 104 114 124 134 144 154 164 174 184 194
>> V = V./(1-V) % 2nd step
V =
-1.3333 -1.0769 -1.0435 -1.0303 -1.0233 -1.0189 -1.0159 -1.0137 -1.0120 -1.0108 -1.0097 -1.0088 -1.0081 -1.0075 -1.0070 -1.0065 -1.0061 -1.0058 -1.0055 -1.0052
Learn how to write MATLAB code:

Catégories

En savoir plus sur Get Started with MATLAB dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by