I need to write down a function 'linzav' which needs to check is the given set of vectors linearly dependent or independent. If it is dependent, write down one vector as linear combination of others?

조회 수: 2 (최근 30일)
i dont know how to even start with this :(
  댓글 수: 2
Rik
Rik 2017년 6월 7일
If it is homework, ask your teacher for a pointer.
You need to find out what it is that Matlab needs to find out for you. How could Matlab check if a set of vectors is dependent? Matlab is very smart, but also very stupid. You have to do the thinking, the designing of the code. Good luck.
In this tutorial you can find some advice on how to come up with answers yourself. It might help you.
Stephen23
Stephen23 2017년 6월 7일
@David Mat: there are thousands of explanations and tutorials online describing how to determine if vectors are linearly independent. This forum has threads on this topic. You will learn more when you do a bit of research: like any coding task, the first step is to understand the task first (implementing the code is just an afterthought, really).

댓글을 달려면 로그인하십시오.

답변 (1개)

H ZETT M
H ZETT M 2017년 6월 7일
A way to start might be something like this:
Vec_1=[1;2;3]
Vec_2=[2;4;6]
Lin=Vec_1./Vec_2
if all(Lin == Lin(1))
disp('linear')
end
So what this code actually does: You first create two vectors (which are of course linear dependent). If you devide one by the other, all elements should be the same if they are linear dependent. The "if" checks if all elements of the linear-resolution are the same. Sorry for my bad english. I hope this helps you to start with the program.

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by