Thanks, can you explain a little bit. how to remember stuff like this as I am keep reading the documents but seems like I am getting stuck everytime I do something new.
data(:,6)=[]; can you explain this line please! and thanks for the modified code.
I don't what to tell you other than to read the explanations and see the general principles behind the examples. The <Array indexing> link at the bottom of the above page starts off with "there are three primary approaches to accessing array elements based on their location (index) in the array. These approaches are indexing by position, linear indexing, and logical indexing."
This is followed by a section on each of the three techniques where in the first section is the information that for multiple elements you can "reference multiple elements at a time by specifying their indices in a vector." and the example of that as r = A(2,[1 3])
It then continues directly thereafter with "To access elements in a range of rows or columns, use the colon." and an example for that syntax as well, r = A(1:3,2:4).
Those are some of the basic principles of MATLAB syntax; they apply to any general indexing situation where you know the numeric value of the desired indices.
As said, you simply must spend some time reading the doc and assimilating the general rules that are explained; there's no substitute for that effort.
There's an OnRamp training course many apparently find helpful; I don't have the direct link to it; I'm certain a search for the term should find it for you.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
0 Comments
Sign in to comment.