Concatenate signals ( sine wave and a line )
3 次查看(过去 30 天)
显示 更早的评论
How can I concatenate a sine wave and a line? I tried something and the error was : Dimensions of matrices being concatenated are not consistent.
4 个评论
回答(3 个)
KALYAN ACHARJYA
2020-12-1
编辑:KALYAN ACHARJYA
2020-12-1
total=[a X Y];
Here "a" is row data, so you must have row-wise (horizontally) concatenate
0 个评论
Star Strider
2020-12-1
You are attempthing to vertically concatenate them.
Use commas (,) instead fo semicolons(;) and it will work. Commas horizontally concatenate and semicolons vertically concatenate.
0 个评论
Timo Dietz
2020-12-1
I guess you want to add a X/Y line after the sine wave, right?
In this case you have to concatenate X + t and Y + a in order to have a new total X and total Y vector.
Looks weird but is this what you wanted to have: plot([t X], [a Y])
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!