difference of a vector, diff()
Afficher commentaires plus anciens
Hi, I'm trying to figure out how to do a simple difference of a vector using HDL coder compatible Simulink blocks. I want to shift the bits so to speak and subtract essentially, so probably need to use some bitrol or something. I.e. I would like to implement the DIFF(X), for a vector X, being [X(2)-X(1) X(3)-X(2) ... X(n)-X(n-1)] using blocks. Thanks
Réponses (1)
Azzi Abdelmalek
le 22 Juil 2016
Use Matlab function block with this code
function y = fcn(u)
%#codegen
y = diff(u);
1 commentaire
DN
le 22 Juil 2016
Catégories
En savoir plus sur Code Generation dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!