Liam - since you are asking the user to enter in the command to "stand" or "hit", then you should be using the strcmpi to compare the input against the conditions. Note also the addition of 's' to indicate string input. For example,
A = input('stand or hit: ', 's');
Also, do not create variable names which are identical to MATLAB functions. In this case, the variable sum conflicts with the sum function. Rename this variable to something that represents what it is: the player hand value. You can also simplify this value as
playerHandValue = sum(playerhand);
while(playerHandValue < 22)
As for drawing a new card from the deck, you will need to keep track of which cards have already been drawn (into the player hand and maybe dealer hand) and then draw the next one from suffledcards. Since two cards have already been drawn from this deck, you could either remove those two cards or just draw the next card using the number of cards that have already been drawn into the player hand
nextDrawnCard = suffledcards(length(playerhand) + 1);
You would then insert the nextDrawnCard into the playerhand and calculate the new sum.