필터 지우기
필터 지우기

How to make normalised frequency distribution plot?

조회 수: 2 (최근 30일)
Pritha Pande
Pritha Pande 2018년 5월 24일
답변: Rishabh Rathore 2018년 5월 30일
I have two 80*80 matrix. I would like to plot normalised frequency plot. So first I tried to normalise the 80* 80 grid with this code: A= per_monsoon_postmon; (A is my 80*80 matrix) A = rand (80,80); minA = repmat(min(A), [size(A, 1), 1]); normA = max(A) - min(A); normA = repmat(normA, [length(normA) 1]);
normalizedA = (A - minA)./normA;
But I don't this code has given me desired result, as Grids with NaN values also has a number in it. for eg. earlier grid 1*1 is NaN now it is 0.8340. Could you please help me how to normalise the 2d matrix and then plot frequency distribution plot.

답변 (1개)

Rishabh Rathore
Rishabh Rathore 2018년 5월 30일
Here's what I understand from your question, you want to normalize A and after normalization the NaNs gets replaced by a number.
From your code, I can see that you are reassigning A using rand(). rand() itself does not creates any NaN, so there are no NaNs in A to begin with and your A is not per_monsoon_postmon rather it is rand(80,80) when it gets normalized.
And your operations to normalize doesn't change NaNs (I tried on Matlab).

카테고리

Help CenterFile Exchange에서 Geographic Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by