Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

function problem

조회 수: 1 (최근 30일)
Mohammad Golam Kibria
Mohammad Golam Kibria 2011년 7월 19일
마감: MATLAB Answer Bot 2021년 8월 20일
I have a function
function [I]=removehole(a,b,c)
I=zeros(size(a));
I called this function from another file as follows:
map=removehole(a,b,1);
where a and b are two matrix;a is logical and b is double.it shows me the following error
??? Index exceeds matrix dimensions. but matlab editor shows the following error:
??? Subscript indices must either be real positive integers or logicals.
I am not sure. why? can any one help?

답변 (1개)

Friedrich
Friedrich 2011년 7월 19일
Hi,
when I do the following it works perfectly:
a = rand(10) > 0.5;
b = rand(10);
removehole(a,b,1)
Do you have a variable called removehole? Because when I do:
removehole = rand(30);
removehole(a,b,1)
??? Index exceeds matrix dimensions.

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by