Solved


Chess probability
The difference in the ratings between two players serves as a predictor of the outcome of a match (the <http://en.wikipedia.org/...

4 years ago

Solved


Roll the Dice!
*Description* Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. *Example* [x1,x2] =...

4 years ago

Solved


Solve a System of Linear Equations
Example: If a system of linear equations in x₁ and x₂ is: 2x₁ + x₂ = 2 x₁ - 4 x₂ = 3 Then the coefficient matrix (A) is: 2 ...

4 years ago

Solved


Magic is simple (for beginners)
Determine for a magic square of order n, the magic sum m. For example m=15 for a magic square of order 3.

4 years ago

Solved


Reverse the vector
Reverse the vector elements. Example: Input x = [1,2,3,4,5,6,7,8,9] Output y = [9,8,7,6,5,4,3,2,1]

4 years ago

Solved


Sum all integers from 1 to 2^n
Given the number x, y must be the summation of all integers from 1 to 2^x. For instance if x=2 then y must be 1+2+3+4=10.

4 years ago

Solved


Calculate Amount of Cake Frosting
Given two input variables |r| and |h|, which stand for the radius and height of a cake, calculate the surface area of the cake y...

4 years ago

Solved


Make the vector [1 2 3 4 5 6 7 8 9 10]
In MATLAB, you create a vector by enclosing the elements in square brackets like so: x = [1 2 3 4] Commas are optional, s...

4 years ago

Solved


Return area of square
Side of square=input=a Area=output=b

4 years ago

Solved


Add two numbers
Given a and b, return the sum a+b in c.

4 years ago

Answered
実数配列と複素数配列を結合してcsv保存する方法
N = 3; X = rand(1,N); % 1×100のdouble配列の変数X (100は長いので3にした) Y = rand(1,N) + i*rand(1,N); % 1×100のcomplex double配列の変数Y Dat...

4 years ago | 1

Answered
【App designer】あ​る区間のデータから、該当する区間の回数を記録するアプリの作成に​ついて
1列目の開始地点(n番目)から数えて2列目に終了地点が見つからない場合(isempty(checkFlag))は、以降のrows(1, n)=0に設定するので、rowsの非ゼロ要素をカウントすれば目的の値が得られます。 numel(find(rows))...

4 years ago | 1

| accepted

Answered
Excelシートに結果を出力する際に末尾のデータではなく列ベクトルの方に追加していく場合
Excel スプレッドシートへのデータの書き込み - MATLAB & Simulink - MathWorks 日本 >末尾​のデータではなく列ベ​クトルの方に追加して​いく場合 ファイルに追記する方法 NewTable = randi(30,[3...

4 years ago | 0

Answered
Excelシートに結果を出力する際に末尾のデータではなく列ベクトルの方に追加していく場合
>末尾​のデータではなく列ベ​クトルの方に追加して​いく場合 一旦ファイルを読み込んで、メモリ上でテーブル列を追加してから(追記ではなく新規に)ファイルに書き込む方法 OldTable = readtable('result2.xlsx'); % 既存...

4 years ago | 0

Answered
plotした順番をグラフ上に載せたいです
データ点に説明テキストを追加 - MATLAB text - MathWorks 日本(複数のデータ点のテキスト) text関数が適します。複数個所に異なるテキストを表示するには、文字列のcell 配列を入力する必要があります。下記の様に作成すればうまく...

4 years ago | 0

Solved


Remove the small words from a list of words.
Your job is to tidy up a list of words that appear in a string. The words are separated by one or more spaces. Remove all words ...

4 years ago

Solved


Find state names that start with the letter N
Given a list of US states, remove all the states that start with the letter N. If s1 = 'Alabama Montana Nebraska Vermont Ne...

4 years ago

Answered
次元の異なる二つの列ベクトルで一番最初に一致する値を検索する方法
集合配列のメンバーである配列要素 - MATLAB ismember - MathWorks 日本 A = [1;2;3;6;7;8;9;10;11;12]; B = [4;5;10;12;14]; common = A(ismember(A,B))...

4 years ago | 0

| accepted

Answered
グラフのべき乗表示を任意の数値に設定したい
【参考】How can I prevent scientific notation on my axes in MATLAB R2015b and later? - (mathworks.com) >べき乗の数字を任意の数字に設定する方法をご存知でしたら...

4 years ago | 1

| accepted

Solved


Switch matrix to a column vector
for e.g. x = [1 2 3 4] y = 1 3 2 4

4 years ago

Answered
カラーマップの任意の範囲の値の色を指定し、それ以外をjetで表示したい
【類似の質問】colorbarの変更に関して - (mathworks.com) cmap = colormap(jet); % カラーマップ"jet"(256*3)を取り出す colormap([zeros(64,3); cmap; zeros(64...

4 years ago | 0

| accepted

Answered
利用可能なフォントの表示
パスの効いたフォルダにファイルlistfonts.mがある為エラーが出ます。 ファイル名を変更すればlistfontsが実行できます。 save('listfonts.m'); ls d = listfonts; movefile listfont...

4 years ago | 0

| accepted

Answered
【App designer】ある区間のデータ数を測定し、データ数の平均を出すアプリの作成について
前回の回答のコメントを踏まえ、for文を使った方で回答します。 質問に提示されたプログラムの問題点は、find関数の2番目の引数(n — 検出する非ゼロの数)を1にしている事です。 idxはスカラ値になりfor n=1:numel(idx)としても1回...

4 years ago | 1

| accepted

Answered
「読み取り専用であるため、クラス 'dtmc' の 'P' プロパティを設定できません。」を解決するにはどうすればよいですか?
which dtmc % 御使用の環境により場所は異なります の最初の方にある properties (SetAccess = private, GetAccess = public) % privateをpublicに変更する P % No...

4 years ago | 0

| accepted

Answered
指定した領域の重心を結んだ中点の検出方法
%% Photoshop画像読込 Icolor = imread('image.png'); I = rgb2gray(Icolor); % グレースケール化 bgc = I(10,10); % 背景色の選択 %% 目と口の重心を求める BW =...

4 years ago | 0

| accepted

Answered
1より小さい数でループ計算を実行するには?
x = -2; % 例として変数xに2を設定 while x < 1 x % ここで変数xを使って計算する x = x + 0.5; end

4 years ago | 0

Solved


Rearrange string
Input is a given string. Output is the number of ways to rearrange the string.

4 years ago

Answered
【App designer】ある区間のデータ数を測定し、データ数の平均を出すアプリの作成について
【プログラム例】 app.data = [0 0 1 1 1 0 0 0 1 1 1 1 1 1 1 1; 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 1]'; idx = find(diff(app.data(:, 1)) >= 1,...

4 years ago | 1

Answered
白飛びを除いたL*a*b*値を求めたいです
画素マスクは2次元データ(幅*高さ)です。 カラー画像は3次元データ(幅*高さ*RGB)なので、上記のマスクをRGB3枚分重ねて適用する必要があります。 L*,a*,b*に分割した画像データは2次元データ(幅*高さ)なので、マスクをそのまま適用できます...

4 years ago | 0

| accepted

Answered
【グラフの作成】Y軸の値からX軸の値を作成する
質問の文脈通りに解釈すれば下記のようになります n = 2; % 探す値 data = [0 1 2 3 4 5]; idx = find(data == n) - 1; % 探す値が含まれるインデックス(0始まり) data2 = (0:2:10...

4 years ago | 1

| accepted

Load more