I think the specific error you got is referring to your return type. Matrix3 has a generic type argument, which is the type of the values that are being stored in it (i.e. f32 or f64). The easiest way to solve this is to just specify this type argument, and since your input values are f64s, Iām assuming you want a Matrix3<f64>, i.e.
fn calculate( a: f64, b:f64) -> Matrix3<f64> {
//calculations here
let m = Matrix3::new(values);
return m
}