Effacer les filtres
Effacer les filtres

Using If statement with data from excel

2 vues (au cours des 30 derniers jours)
rammah nagi
rammah nagi le 26 Juil 2019
Commenté : Star Strider le 26 Juil 2019
Hi, I would like to write an if statement where if RTcout<Ta , RTcout=Ta. The difficulty im having is that Ta has not been defined in the script but has been subbed into equations. Below is an example of the code:
Tcout1 = (subs(Tcout,{J,Ta,Vw},{numData1(2:25,6)',numData1(2:25,8)',numData1(2:25,12)'}));
RTcout = real(Tcout1);
Any help would be appreciated.

Réponse acceptée

Star Strider
Star Strider le 26 Juil 2019
Do the threshold operation before you do the substitution:
numData = randi(500, 1, 10); % Original Data
JData = numData; % Create New Data Vector
JData(Jdata < 200) = 0; % Threshold Or Substitute Data
syms a b J
v = a*b + J;
vnew = subs(v, {J,a,b},{numData', randi(9,1,10)',randi(9,1,10)'}) % Substitute Thresholded Data
It would be more illustrative with your code and data, however we do not have enough of that to use.
  4 commentaires
rammah nagi
rammah nagi le 26 Juil 2019
Thank you very much
Star Strider
Star Strider le 26 Juil 2019
As always, my pleasure.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Produits


Version

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by