Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

function problem

2 visualizaciones (últimos 30 días)
Mohammad Golam Kibria
Mohammad Golam Kibria el 19 de Jul. de 2011
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
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?

Respuestas (1)

Friedrich
Friedrich el 19 de Jul. de 2011
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.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by