how to modify a variable data by scale function like data= scale(data); I have to modify scale function for variable data

how to modify a variable data by scale function like data= scale(data); I have to modify scale function for variable data
Actually i am writing a matlab code for training in Matlan onramp and didn't getting how to solve the above

 采纳的回答

Given only the above information:
function scaled = scale(data)
scaled = data ./ 1000;
end
The 1000 should be adjusted to whatever is appropriate for your situation.

5 个评论

FYI, in a more general case (not just writing a scaling function for a MATLAB Onramp exercise) the rescale and/or normalize functions could be useful.
how to recall scale function if it is unused.
function scaled = scale(data)
scaled = data ./ 1000;
end
When i try to submit my code for onramp exercise this message appears: Has the variable data been correctly modified by the scale function?
Looks like the exercise wanted some different scaling. Perhaps multiplying by 173, or dividing by 32768...
"Actually i am writing a matlab code for training in Matlan onramp and didn't getting how to solve the above"
The linked page already tells you the complete content of the SCALE function and exactly where to write it.

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Get Started with MATLAB 的更多信息

产品

版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by