Filter löschen
Filter löschen

Z must be size 2x2 or greater. HELP

2 Ansichten (letzte 30 Tage)
Kayn
Kayn am 8 Nov. 2013
Beantwortet: Vivek Selvam am 8 Nov. 2013
A real amateur here so any real help would be appreciated. I keep getting that error code for this script
kRx = linspace(0,10);
kRz = linspace(0,10);
kRy = 0;
kR = kRx + kRy + kRz;
[kRx,kRz] = meshgrid(kRx,kRz);
T1 = cos(kR) + kR .* sin(kR);
T2 = kR.^2.*cos(kR);
T3 = T1 - T2;
T4 = T3*cos(kRz);
T5 = T4 ./ (kR).^3;
contourf(kRx,kRz,T5,500)
-----------------------------------------
Any help would be really appreciated!

Akzeptierte Antwort

Vivek Selvam
Vivek Selvam am 8 Nov. 2013
1. T5 needs to be a matrix but is a vector. Check size(T5).
You would want to change the order of these lines from
kR = kRx + kRy + kRz;
[kRx,kRz] = meshgrid(kRx,kRz);
to
[kRx,kRz] = meshgrid(kRx,kRz);
kR = kRx + kRy + kRz;
2. T5 formula would create Infinity since kR can be 0.
kRx = linspace(0.1,10) and same for kRz should fix that.

Weitere Antworten (1)

Azzi Abdelmalek
Azzi Abdelmalek am 8 Nov. 2013
T5 should have the same size as kRx and kRz

Kategorien

Mehr zu Simulink 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