plotting x and y differential

hello
I have plotted x and y data and seen evidence of a bifurcation. I want to plot x vs diff y.
this is what i did :
plot(nslogistic.x,diff(y))
this is what i got:
Error using plot
Data must be numeric, datetime, duration or an array convertible to double.
is it possible to plot x data and y differential?
gs

댓글 수: 5

Turlough Hughes
Turlough Hughes 2020년 3월 11일
The issue appears to be the class of the variables that you are inputting into the plot function. What is printed to screen when you enter nslogistic.x or diff(y) into the command line?
Gavin Seddon
Gavin Seddon 2020년 3월 12일
Yes it appears I need to update the table with a V column then plot columns 1 and 3.
should i ask a new question or can someone tell me how to update the table with a diff y column?
GS
Turlough Hughes
Turlough Hughes 2020년 3월 12일
편집: Turlough Hughes 2020년 3월 12일
I would start by saving your variables from the workspace as a .mat file and attaching the file to this question. The question is still about ultimately plotting the differential of y as a function of x so I don't think you need to ask another question. By a V column I assume you mean velocity?
Gavin Seddon
Gavin Seddon 2020년 3월 12일
yes thank you. can you tell me how to print diff y into a third column (v) ? i will perform the work on the .mat file to save you doing it.
GS
Turlough Hughes
Turlough Hughes 2020년 3월 12일
Please upload the .mat file containing the variables nslogistic and y.

답변 (1개)

Raynier Suresh
Raynier Suresh 2020년 3월 18일

1 개 추천

diff(Y) function calculates the difference between adjacent elements of Y along the first array dimension whose size is not equal 1. But to find the derivative of Y with respect to X you can use diff(Y)/h where h is the step size in X, if X doesn’t have equal step size then you can use diff(Y)./diff(X).
While using plot function make sure that the data type of the input arguments must be one of these type single, double, int8, int16, int32, int64, uint8, uint16, uint32, uint64, categorical, datetime, duration
Referring to the following links might be helpful:

이 질문은 마감되었습니다.

질문:

2020년 3월 11일

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by