Hello, I want to solve the following equation: 1/c0 c^2 - c +X*t / c0 = 0 where c0 is a given constant but X and t are constant arrays: they are data sets where X varies with time, t. The goal is to solve for c, which too will be a data array that varies with time, t. I tried: func = @(c) 1/c0.*c^2 - c + X.*t/c0; c = fzero(func,1) But got errors likely because X and t are arrays and not single values. Any other ideas? Time sensitive, thank you!!!
Kshitij Singh answered .
2025-11-20
XTc0 = X.*t./c0; c = arrayfun(@(xtc0) fsolve(@(c) 1/c0.*c.^2 - c + xtc0), XTc0)