MATLAB Create function from a vector in matlab

AI Thread Summary
To create a function f(t) in MATLAB from a column vector c, where f(fstep) corresponds to c(cstep) with cstep as an integer, interpolation techniques can be utilized. The goal is to define f(t) such that it maps continuous values of t to discrete values of c, allowing for calculations like sin(t)*f(t). Users may consider using MATLAB's interpolation functions, such as interp1, to achieve this mapping effectively. Providing additional context or step-by-step implementation details can enhance understanding and facilitate better solutions. This approach enables seamless integration of discrete data into continuous mathematical functions.
_zeQ
Messages
2
Reaction score
0
Hi everyone,

Lets say i have created a column vector c = [ N x 1 ] and my time vector has the same dimensions.

I want to create a function f(t) in which f(fstep) = c(cstep) where cstep is integer and fstep maybe not.
( for example f(0)=c(0), f(0.1)=c(1), ... f(10)=c(100))

As a result i will be able for example to do the calculation sin(t)*f(t).

Thanks
 
Physics news on Phys.org
I am attaching a document that can be useful (Chapter 1 and Chapter 2). Hope this helps, of course it would be helpful if I explain step by step what you intend to implement.
regards
 

Attachments

Last edited:

Similar threads

Replies
8
Views
2K
Replies
4
Views
1K
Replies
1
Views
2K
Replies
8
Views
3K
Replies
5
Views
2K
Replies
2
Views
2K
Replies
2
Views
1K
Back
Top