Question1: How to express attt without having this error? can not implicitly convert type double to double? This error refers to line 7.
Question2: How to calculate this value? mymax = maximum (attt, attt, ...attt[count])? Please note that i want to subtract attt from mymax that is in my first question but both if them are at the same loop. But if it can't be at the same loop, please code it somehow that it works.
Thanks in advance for your time and help.
Double to double? The message probably has more than that.
subtract attt from mymax attt - mymax
Who substracts from whom?
You have two lists of values, old and neww. They must have same number of elements and they must have at least one element each.
You compute elementwise difference of the two lists; a new list.
However, you apparently don't want a whole list, just the largest difference and the difference of the first pair: auto result = neww - old - mymax;
How to calculate maximum(attt, attt, ...attt[count])?
Is that the maximum of whole list or does it omit the first (attt)?
You do look each element in turn. If its value is larger than the largest value (mymax) that you have seen so far, then you must update the mymax. When you have seen all the values, the mymax must hold the largest value of the whole list.
You have attt and attt and they are entirely different. One is a double value. The other is an array of double values. One number, many numbers. Not possible. Rename one of the two.
It is apparent that you do need attt later. However, you have not stated that you would need attt for anything else than computing the attt. (Was that clear? Not ambiguous? Can you tell which attt is which? Rename one.)
When i insert attt in another defined function like beliw, it works fine without any problem.
But when i add it to thus function, attt = attt- mymax; the double to double conversion problem arises.
What should i do now to fix it? :(