Normalize using first element of vector
4 次查看(过去 30 天)
显示 更早的评论
I want to normalize the elements of the following vector using the first element. I want the first element of my vector 'stock_market' to be 100 and the other elements of the vector to be normalized according to that value. I used the normalize function:
stock_market = readmatrix('^FTSE.csv' , 'Range' , 'F2:F313')
norm_stock_market = normalize(stock_market , 'scale' , 'first' , '100')
but I am getting an error.
Any help would be appreciated. Thanks!
0 个评论
采纳的回答
Ameer Hamza
2020-10-3
编辑:Ameer Hamza
2020-10-3
A = [10 20 15 12];
A_new = A/A(1)*100;
Using normalize()
normalize(A, 'scale', 'first')*100
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!