フィルターのクリア

Custom function,how to make custom function or graph in matlab

2 ビュー (過去 30 日間)
Rehan
Rehan 2015 年 4 月 18 日
編集済み: Image Analyst 2015 年 4 月 18 日
Hello Sir, I have read many solutions of yours,which you given,you are nodoubt helping people,i also have a problem,i want to make a custom function,i am attaching picture,please have a look and tell me if i have x(i,j) values 0 to 10 and these values are on x-axis so how i can find values by puting this formula Xmd(x(i,j)). on x-axis L=11,so values on x-axis are o to 10 and on y axis values are from 0 to 1. thanks

採用された回答

Image Analyst
Image Analyst 2015 年 4 月 18 日
So just make a function
function signal = MakeSignal(a, b, L, yHeightAtB, numElements)
x = linspace(0, L-1, numElements);
y = ones(1, numElements); % Initialize
slope2 = .....
segment2 = x >= a & x <= b;
y(segment2) = equation of that line.....
segment3 = x >= b;
y(segment3) = equation of that line.....
That's a good start - go ahead and finish it.
  1 件のコメント
Rehan
Rehan 2015 年 4 月 18 日
編集済み: Image Analyst 2015 年 4 月 18 日
Thank you very much sir.you helped me a lot.here is the solution which i have done. 5 stars
clear all
clc
a=100;
b=160;
L=256;
numElements=256;
x = linspace(0, L-1, numElements);
y = ones(1, numElements);
slope2 =-0.01;
for i = a:b
y(i)=(-0.01*i)+2;
end
for j=b:L-1
y(j)=(-0.004*j)+1;
end

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSignal Attributes and Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by