How can I create a loop to check each matrix element?

조회 수: 2 (최근 30일)
Omar
Omar 2022년 12월 2일
댓글: Stephen23 2022년 12월 2일
Question: Design an appropriate parsing strategy among multiple solutions that will go through all 16 possible solutions and discard the invalid ones, therefore reducing the output of the analytical inverse kinematics to a subset of m, with m ϵ [0:16] ( Matlab Script)
This should be written in Matlab
I am trying to write a parsing algorithm that checks values in a 16x6 matrix scanning through the matrix and replacing values, not within the specified range with 180 degrees while keeping the valid values intact
The matrix contains 6 columns which represent the theta 1-6 values and each theta value has its own range i.e theta 1 has a range between -90 to 90, theta 2 has a limit btw -180 to 180 and etc
My design approach so far:
I have defined the specified ranges for the 6 theta values (theta 1- theta 6)
I am trying to write a logic that checks the 16x6 matrix using a for loop and set of If statements( if there is an alternative approach I would gladly appreciate) that would scan through each row and column and check if each value is within its appropriate range and then it outputs an updated matrix with valid values within the specified range and replaces the invalid ones (values not within the specified range with 180 degrees.)
Any sample script/Suggested Approach to this would be appreciated
  댓글 수: 11
Omar
Omar 2022년 12월 2일
이동: Stephen23 2022년 12월 2일
The assigment specifies using a loop with if statements
Stephen23
Stephen23 2022년 12월 2일
"The assigment specifies using a loop with if statements"
So your teacher wants one simple loop. What have you tried so far?

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

답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by