I am trying to make a matrix (10x100) called 'DemClay' with a slope of -1 to -0.5 incrementally if possible, so that the first row is -1 and the last row is -0.5
    1 visualizzazione (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
    Omar Elbadi
 il 26 Feb 2022
  
    
    
    
    
    Commentato: Omar Elbadi
 il 1 Mar 2022
            v= [-0.95:0.05:-0.5];   % for the slope -1 to -0.5
V= transpose(v);
for i=1:NPixX   % number of pixels, given as 100 
  DemClay = zeros(10,100);
  display(V(:,i))
end
0 Commenti
Risposta accettata
  John D'Errico
      
      
 il 26 Feb 2022
        
      Modificato: John D'Errico
      
      
 il 26 Feb 2022
  
      Pretty easy. And soooo many ways to do it. This is a simple one:
DemClay = repmat(linspace(-1,-0.5,10)',[1,100]);
size(DemClay)
surf(DemClay)
Più risposte (0)
Vedere anche
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
