Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
Does it mean that Tom, 1,2 etc. are in the first column of your read-in data and Alan, 5, 6 in the second?
Are the numbers numerical data or are the read in as text?
Can you rule out that something like "6, Jone" or "Tom, 5" occurs? That means, a row either contains numerical data only or text only.
You write that you have a lot of columns and your example seems to show only 2. What if you have 30 or more columns - do you really want each numerical column data in its own variable (I, J ,.....??)? Wouldn't it suffice to simply delete all not numerical data and returned the cleaned matrix?
Guess it would be helpful if you can provide an example of a read-in matrix and the desired output.
Here is a first suggestion
Later in your file you write
I have no idea what you really want with this. Are you looking for a command like "submatrix" ?
I skipped the rest of your file and if the regions there have nothing to do with your question, you should delete them before posting the file.
@ppal wrote:
Well you could replicate the two columns to 2000 columns if it helps.
The question was if you really insist on the result being 2000 separate variables as you example shows (I, J,....) in that case 😉
A matrix consisting of just the rows with numerical values seem more appropriate, especially when you have many columns.
Given from the rest you wrote I guess that I already provided a solution (the expression which starts with "trim").
If you expected a different result, you would have to explain in more detail what you would like the result to look like.
submatrix works for me.
@ppal wrote:
Question as per attached Prime 7
Thanks
For those with Mathcad Express, here's one possible functional version.
First, some preliminary list processing function definitions:
Then the definition of the filter function and its application to the test data. This version uses the function stkdn to ensure that :
And, finally, a slightly different implementation of filter that removes w's initial value at the end of filtering. It has the disadvantage that v must be a single-column array.
Implemented in Mathcad Express 7.
Stuart