已回答
画像をパディングし正方形にする方法
関数 padarray を使って、以下のようにする方法はいかがでしょうか? % サンプル画像 (1000×200ピクセル) I_in = randi(255, [1000 200], "uint8"); % 縦横のピクセル数とその差を取得 sz...

3 years 前 | 1

| 已接受

已回答
エラーバーを任意の点だけ表示する方法はありませんか
plot と errorbar を同じ色で重ねて表示する方法はいかがでしょうか? たとえば 25個の (x,y) データがあり、5, 10, 15, 20番目のデータのみにエラーバーを表示したいとすると、以下のようになります。 % データ x = 1...

3 years 前 | 0

| 已接受

已回答
saving 3 dimensional data in excel file in a particular format
How about the following? for kk = 1:5 writematrix(squeeze(A(kk,:,:)), "yourExcel.xlsx", "Sheet", kk); end

3 years 前 | 1

| 已接受

已回答
x, yの実験データに対し、x,yを両辺に複数もつ複雑な理論式(x,yを変数とし、未知の係数を含む関数)によってフィッティングする方法を教えてください。
いくつかやり方がありますが、たとえば (x, y) の全データに対する左辺と右辺の差の二乗和を「 (a, b) を入力変数とする関数」として定義して、fminsearch で (a, b) の最適値を求めるというのはいかがでしょうか?

3 years 前 | 0

已回答
Using load for different files with varying names
How about the following? for kk = 1:25 fileName = sprintf('data%d.mat', kk); load(fileName) % % Some proce...

3 years 前 | 1

| 已接受

已回答
円を配列で表す
いろいろなやり方があると思いますが、たとえばMATLABの基本関数のみを使う以下の方法はいかがでしょうか? % 初期配列 J = repmat(6.5, 710, 710); % 中心 (335, 335), 半径 135 の円内のグリッド点を示...

3 years 前 | 3

| 已接受

已回答
Find value based on adjacent value condition and insert into new variable
ismember function will be helpful for this task, like: % Sample matrix A = [(0:50)', rand(51,1)]; % Second matrix with inde...

3 years 前 | 1

| 已接受

已回答
Rename a lot of files
How about the following? fileList = dir('*.csv'); for kk = 1:numel(fileList) fileNum = extractBetween(fileList(kk).name,'...

3 years 前 | 1

已回答
Trying to plot a temperature distribution and generate a temperature contourn!
How about the following? L = 1; W = 1; [xGrid, yGrid] = meshgrid(0:0.025:1, 0:0.025:1); T = zeros(size(xGrid)); for n =...

3 years 前 | 2

| 已接受

已回答
How to find the midpoint between two curves in an image
How abou the following? % Load image I = imread('https://jp.mathworks.com/matlabcentral/answers/uploaded_files/1079075/curve.P...

3 years 前 | 1

| 已接受

已回答
I need to repeat numbers in an array with a certain number of repetitions for each value without(repelem or repmat)
I'm not sure why you do not prefer repelem/repmat... Anyway, how about the following solution? % Example list_1 = [2;3;5;6]; ...

3 years 前 | 2

| 已接受

已回答
Trouble using split function in matlab
How about the following? % Example dates = {'3/11/9102'; '3/12/9102'; '3/13/9102'; '3/14/9102'; '3/15/9102'}; % Split by '/...

3 years 前 | 2

| 已接受

已回答
Find the missing rows and newly added rows in two different excels sheets
How about the following? % Load the Excel files tNew = readtable('https://jp.mathworks.com/matlabcentral/answers/uploaded_file...

3 years 前 | 2

| 已接受

已回答
MPR-CTを読み込んで3Dとし、一部を球近似することはできますか?
MPR-CT画像から既に 3D モデルは作成済みだと想定します。 3D モデルが 3次元のバイナリイメージの形で利用可能だとすると、regionprops3 関数を使ってそれぞれの重心座標を算出できます。また、この関数でボリュームサイズも取得できますので...

3 years 前 | 0

已回答
Average of every 25 rows in a table
Another possible solution: % Sample data data = rand(1000, 10); % Grouping group = repelem(1:size(data, 1)/25, 25)'; % ...

3 years 前 | 1

已回答
ベクトルと平面のなす角の算出
順を追って説明します。 まず、ベクトル a と b のなす角は以下の式で求められます。 では平面とベクトル a のなす角は??というご質問ですが、考えてみると平面の法線ベクトルを使って求められそうです。 たとえば平面の法線ベクトルを n とすると...

3 years 前 | 2

已回答
Storing values in a matrix out of nested for loops
how about the following? m1 = [0.5; 0.5]; m2 = [0.6; 0.4]; m3 = [0.2; 0.8]; [q, p, r] = meshgrid(m2, m1, m3); s4 = p.*q.*r;...

3 years 前 | 1

| 已接受

已回答
データ数の圧縮,リサンプリング,補間について
時系列信号のリサンプリングに関するご質問と想定して回答します。 ご理解のとおり、resample 関数を使ってこの課題を解決するには、目標のサンプル点数に対応するサンプリング周波数を求める必要があります。 もっと簡単な別の方法として、関数 interp...

3 years 前 | 0

| 已接受

已回答
Read csv file 2 and 3rd row and store them in different matrices
How about the following? % File path url = 'https://jp.mathworks.com/matlabcentral/answers/uploaded_files/978985/2022-04-22%2...

3 years 前 | 1

| 已接受

已回答
How to convolve a 3D matrix along one of its dimension?
The function smoothdata must be applicable, like: % Sample data A = rand(100, 100, 2000); % Gaussian filter window win = 1...

3 years 前 | 1

已回答
This file format i want to extract time and Value. What should I do??
How about the following? % Read and arange the data url = 'https://jp.mathworks.com/matlabcentral/answers/uploaded_files/97604...

3 years 前 | 1

已回答
フォルダー内の画像のlab値を読み取り,それぞれの値を変数l,a,bに代入する.
以下のような処理のイメージでしょうか? % フォルダー内の画像を読み取る. I = imread('peppers.png'); % 画像のlab値を読み取る. Ilab = rgb2lab(I); % 変数l,a,bを定義し,画像のla...

3 years 前 | 0

| 已接受

已回答
行列の各行に対してラベル付け
グラフ理論を使う方法はどうでしょうか? 配列Aの各要素をノード番号、各行をエッジとみなすと、配列からグラフGを構成することができます。 すると、「求めたいラベル番号」は「エッジが属するサブグラフの番号」と等価になります。 言葉だけでは分かりにくいと思...

3 years 前 | 2

| 已接受

已回答
BPSK modulatorブロックの搬送周波数について
おそらく BPSK Modulator Baseband ブロックに関するご質問かと思いますが、このブロックは名称のとおりベースバンド信号を生成します。このため、ある搬送波周波数 [Hz] のBPSK信号を生成するには、このブロックの出力を別途 でアッ...

3 years 前 | 0

| 已接受

已回答
Vector to Indicate if Data equals the Maximum by group
How about the following? data = [1;2;3;6;5]; group = [1;1;2;3;3]; idx = splitapply(@(x) {x == max(x)},data,group); idx = c...

3 years 前 | 1

| 已接受

已回答
2つ以上の同じ要素を持つ列を削除
arrayfun 使った別の方法: % 配列の一例 (行・列数は任意) A = [... 1 2 3 4 5;... 2 3 4 4 6;... % -> 削除 7 5 5 5 2;... % -> 削除 0 9 7 8 1];...

3 years 前 | 1

已回答
Finding the value of the below curve
If you have a Signal Processing Toolbox, pulsewidth function will be a simple and effective solution.

3 years 前 | 1

已回答
finding the slope of each segement in a fitted curve
By applying interpolation, you can decrease and, as a result, the deviation will be more accurate. The following is an example...

3 years 前 | 2

已回答
Plot summation series | For Loop | Creep Strain
How about the following? s = 100; % constant tensile stress, (MPa) t = linspace(0, 10000)'; % duration of applied stress on sp...

3 years 前 | 0

已回答
構造体から特定のデータを抜き出す方法
関数 structfun をうまく使うと、ID = true の要素だけを抽出した構造体 t01_ver1 を作成することができます(下記 Solution 1)。 ただ、このようなデータであればテーブル型変数にしたほうが扱いやすいと思いますので、テーブ...

3 years 前 | 0

加载更多