フィルターのクリア

i am getting error when i am reading file

9 ビュー (過去 30 日間)
siddhanth madhavan
siddhanth madhavan 2021 年 10 月 25 日
コメント済み: siddhanth madhavan 2021 年 10 月 25 日
%the program%
a = csvread('matrix.csv');
b = csvread('vector.csv');
disp(a);
disp(b);
n = length(b)
x = zeros(n,1)
aug = [a b]
for j = 1 : n-1
for i = j+1 : n
m = aug(i,j)/aug(j,j);
aug(i,:) = aug(i,:)-m*aug(j,:);
end
end
aug
x(n) = aug(n,n+1)/aug(n,n);
for k = n-1: -1 : 1
x(k) = aug(k,n+1)-aug(k,k+1:n)*x(k+1:n) / aug(k,k);
end
x
%the error i get%
The optional second input to exist must be 'var', 'builtin', 'class', 'dir' or 'file'.
Error in csvread (line 34)
if exist(filename,'vector') ~= 2
Error in eva2gausseliminationmethod (line 1)
a = csvread('matrix.csv');
  4 件のコメント
siddhanth madhavan
siddhanth madhavan 2021 年 10 月 25 日
this is what its returning
siddhanth madhavan
siddhanth madhavan 2021 年 10 月 25 日
in my progran its not reding the file which i have

サインインしてコメントする。

回答 (1 件)

Sobha T
Sobha T 2021 年 10 月 25 日
Please try using readmatrix() instead.
https://in.mathworks.com/help/matlab/ref/csvread.html
  2 件のコメント
siddhanth madhavan
siddhanth madhavan 2021 年 10 月 25 日
Error using readmatrix (line 146)
Unable to find or open 'matrix.csv'. Check the path and filename or file permissions.
Error in eva2gausseliminationmethod (line 1)
a = readmatrix('matrix.csv');
siddhanth madhavan
siddhanth madhavan 2021 年 10 月 25 日
i am still getting this error

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeText Files についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by