How to generate data from Function and save in CSV in MatLab?

조회 수: 7 (최근 30일)
Md. Mazid-Ul-Haque
Md. Mazid-Ul-Haque 2021년 3월 31일
답변: Walter Roberson 2021년 4월 7일
I am new to this area. I have a list of functiones from which I need to generate data using MatLab and also need to store the data in a CSV file.
It would be very helpful if anyone could show me the process for one function so that I can do the rest of the functions following the instructions. I am attaching an image. Here [-100,100] is range and 0 is f_min

답변 (1개)

Walter Roberson
Walter Roberson 2021년 4월 7일
n = 20;
x_i = rand(1,n);
f11 = @(x) exp(-mean(x.^2));
y_i = f11(x_i)
y_i = 0.7040
dlmwrite('test.csv', y_i)

카테고리

Help CenterFile Exchange에서 MATLAB Code Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by