Filter löschen
Filter löschen

error to perform assignment

2 Ansichten (letzte 30 Tage)
Titas Chattopadhyay
Titas Chattopadhyay am 3 Apr. 2020
Kommentiert: Mehmed Saad am 3 Apr. 2020
clear all
clc
z = -1:0.2:1;
y = -1:0.2:1;
n = -2:0.4:2;
h = 3;
alpha = 0.1;
m = 11;
for j = 1:m
for i = 1:m
w1(i) = sinh(n.*pi.* (i+1));
w2(j,i) = 0.18.*(alpha + 1).*cos(((j+1).*pi)/h).*((i+1).^2 - (i+1));
w = w1(i) + w2(j,i);
end
end
plot(w1,z(1,:),'bo-','linewidth',1)
legend('W2','Z');
hold on
%grid on
plot(w,z(1,:),'r-','linewidth',1)
axis([-1 1 -1 1])
error : Unable to perform assignment because the indices on the left side are not compatible with the size
of the right side.
  1 Kommentar
Mehmed Saad
Mehmed Saad am 3 Apr. 2020
  1. w1 and w2 are not initialized
  2. n is a vector and sinh(n.*pi.*(i+1)) will give you out a vector, you are trying to assign a vector to an index of w1 which is wrong

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by