Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some confusion in gsw_resize.m #20

Open
xiehanzhou opened this issue Dec 1, 2023 · 1 comment
Open

Some confusion in gsw_resize.m #20

xiehanzhou opened this issue Dec 1, 2023 · 1 comment

Comments

@xiehanzhou
Copy link

Hi, I think the following approach doesn't seem to meet the requirements of the function itself.

data = data(ones(1,sz_SA(2)), :);

It should be
data = data(:,ones(1,sz_SA(2)));
The following all have similar issues
data = data(:,ones(1,sz_SA(1)));

data = data(ones(1,sz_SA(2)),:);

data = data(:,ones(1,sz_SA(1)));

If I have any misunderstandings about functions, please point them out. Thanks

@xiehanzhou
Copy link
Author

Using gsw_resize function yields this result

>> data = 1:10;
n = [10,10];
data1 = gsw_resize(data,n)

data1 =

     1     1     1     1     1     1     1     1     1     1

It uses data = data(:,ones(1,sz_SA(1)))
I think it should be

>> data2 = data(ones(1,n(1)),:)

data2 =

     1     2     3     4     5     6     7     8     9    10
     1     2     3     4     5     6     7     8     9    10
     1     2     3     4     5     6     7     8     9    10
     1     2     3     4     5     6     7     8     9    10
     1     2     3     4     5     6     7     8     9    10
     1     2     3     4     5     6     7     8     9    10
     1     2     3     4     5     6     7     8     9    10
     1     2     3     4     5     6     7     8     9    10
     1     2     3     4     5     6     7     8     9    10
     1     2     3     4     5     6     7     8     9    10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant