MATLAB Answers

Cody Abt
0

How Do I add user input to a matrix already defined in my work space?

Cody Abt
さんによって質問されました 2019 年 9 月 15 日
最新アクティビティ Prabhan Purwar さんによって 回答されました 2019 年 9 月 19 日
How do I add user input to a matrix already defined in my work space?
Matrix in work space is a 16x1 and Im trying to be able to add user input on whatever day they chose to the matrix to be able to update with new day they are asking for.

タグ

1 件の回答

回答者: Prabhan Purwar 2019 年 9 月 19 日

Following code illustrates the updation of data matrix based on user input
clc
close all
clear
%Defining a 16*1 random matrix
mat=rand(16,1);
%assuning 1 to 16 represents days
%User defined input
day=input('Enter day');
value=input('Enter value');
%Update value
mat(day)=value;
Please refer the following link for further information

  0 件のコメント

サインイン to comment.



Translated by