Answered

using matlab fileread function for some portion of text data

Use function textscan to read the first 50 lines and the header will be stored on a cell array. fid = fopen(fullfile(filepath,f...

using matlab fileread function for some portion of text data

Use function textscan to read the first 50 lines and the header will be stored on a cell array. fid = fopen(fullfile(filepath,f...

3 maanden ago | 1

| accepted

Answered

Subplot arrangement: 6 by 2 plot

Try this: figure(1) subplot(6,2,1) plot(1:10,randi(10,1,10)) hold on subplot(6,2,3) plot(1:10,randi(10,1,10)) subplot(6,2...

Subplot arrangement: 6 by 2 plot

Try this: figure(1) subplot(6,2,1) plot(1:10,randi(10,1,10)) hold on subplot(6,2,3) plot(1:10,randi(10,1,10)) subplot(6,2...

3 maanden ago | 0

| accepted

Answered

How to label the centers of circles according to their position on axes?

Try this and still using function text: clear; clc; I = ones(400,600); sorted_centers_x = repmat(50:100:550,1,4); sorted_cen...

How to label the centers of circles according to their position on axes?

Try this and still using function text: clear; clc; I = ones(400,600); sorted_centers_x = repmat(50:100:550,1,4); sorted_cen...

3 maanden ago | 1

| accepted

Answered

How to use imwrite from dicom to png

It may contains more than one image and hence you need to save it one by one: Following code for your reference: [I, cmap] = d...

How to use imwrite from dicom to png

It may contains more than one image and hence you need to save it one by one: Following code for your reference: [I, cmap] = d...

3 maanden ago | 0

| accepted

Answered

Specific conditions for array elements

You may simply combine them together as follows: B = (A>10)*(9^2)+(A==10)*0+(A<10)*(20^0.5);

Specific conditions for array elements

You may simply combine them together as follows: B = (A>10)*(9^2)+(A==10)*0+(A<10)*(20^0.5);

3 maanden ago | 1

Answered

Replacing Empty Cells by NaN

T.Var1=NaN(size(T.Var1,1),1); % Replace T.Var1 by NaN T.Var16=NaN(size(T.Var16,1),1); ...

Replacing Empty Cells by NaN

T.Var1=NaN(size(T.Var1,1),1); % Replace T.Var1 by NaN T.Var16=NaN(size(T.Var16,1),1); ...

3 maanden ago | 0

Answered

How do I concatenate the same table n-times vertically?

Try this: biggertable=repmat(T,1000,1);

How do I concatenate the same table n-times vertically?

Try this: biggertable=repmat(T,1000,1);

3 maanden ago | 0

| accepted

Answered

I'm working on an example where I'm getting a logical error possibly. I want to replace every element of a matrix by the minimum of its neighborhood.

The value of N will be very large in the loop and gives an error. Try the following to replace each element of the matrix by by...

I'm working on an example where I'm getting a logical error possibly. I want to replace every element of a matrix by the minimum of its neighborhood.

The value of N will be very large in the loop and gives an error. Try the following to replace each element of the matrix by by...

3 maanden ago | 0

| accepted

Answered

Unrecognized function or variable 'wavread'.

It requires Signal Processing Toolbox, type 'ver' in the Command WIndow to check whether you have the right Toolbox or not.

Unrecognized function or variable 'wavread'.

It requires Signal Processing Toolbox, type 'ver' in the Command WIndow to check whether you have the right Toolbox or not.

3 maanden ago | 0

Answered

stl file rendering is not working can you help me to solve it?

You may need <https://www.mathworks.com/help/matlab/ref/trisurf.html trisurf> or <https://www.mathworks.com/help/matlab/ref/trip...

stl file rendering is not working can you help me to solve it?

You may need <https://www.mathworks.com/help/matlab/ref/trisurf.html trisurf> or <https://www.mathworks.com/help/matlab/ref/trip...

3 maanden ago | 0

Answered

How to extract matrix from cell?

Try this: iwant=cat(4,myCell{32:59});

How to extract matrix from cell?

Try this: iwant=cat(4,myCell{32:59});

3 maanden ago | 0

| accepted

Answered

How to delete duplicates and replace values in an array?

Create a table and use function groupsummary Item=["White Onion";"Potato";"White Onion";"Fruit"]; T=table(Item,'VariableNames'...

How to delete duplicates and replace values in an array?

Create a table and use function groupsummary Item=["White Onion";"Potato";"White Onion";"Fruit"]; T=table(Item,'VariableNames'...

3 maanden ago | 0

| accepted

Answered

How to request a specific user input?

May do this ina while loop prompt = 'Please enter 1 for EXP1 and 2 for EXP2:'; % ask EXP = input(prompt); while (EXP ~= 1 && ...

How to request a specific user input?

May do this ina while loop prompt = 'Please enter 1 for EXP1 and 2 for EXP2:'; % ask EXP = input(prompt); while (EXP ~= 1 && ...

3 maanden ago | 0

Answered

How can I write a for loop to do algebra over multiple arrays?

Try this: A = arrayfun(@(x) x.*time./(c+d), a, 'UniformOutput', false) result = cell2mat(A')

How can I write a for loop to do algebra over multiple arrays?

Try this: A = arrayfun(@(x) x.*time./(c+d), a, 'UniformOutput', false) result = cell2mat(A')

3 maanden ago | 0

Answered

How does one use bookmark feature in Livescript?

Refer to the following, a cyan marker will appear: Check this : Bookmarks

How does one use bookmark feature in Livescript?

Refer to the following, a cyan marker will appear: Check this : Bookmarks

3 maanden ago | 0

| accepted

Answered

How to label axis appropriately in subplot

Just tell it to output x-label when the number of subplot > 10 x=1:8; for k = 1:15 data = rand(1,8); subplot(3,5,k)...

How to label axis appropriately in subplot

Just tell it to output x-label when the number of subplot > 10 x=1:8; for k = 1:15 data = rand(1,8); subplot(3,5,k)...

3 maanden ago | 1

Answered

I am trying to plot an stl file but it showing error

function <https://www.mathworks.com/help/matlab/ref/trimesh.html#d123e1396060 trimesh> is another option

I am trying to plot an stl file but it showing error

function <https://www.mathworks.com/help/matlab/ref/trimesh.html#d123e1396060 trimesh> is another option

3 maanden ago | 1

Answered

Find minimum values of 2nd column of matrices in a cell

cellfun(@(x) min(x(:,2)),A) % where A is your 8x1 cell

Find minimum values of 2nd column of matrices in a cell

cellfun(@(x) min(x(:,2)),A) % where A is your 8x1 cell

3 maanden ago | 1

| accepted

Answered

How to plot on two y- axis

use function yyaxis <https://www.mathworks.com/help/matlab/ref/yyaxis.html yyaxis>

How to plot on two y- axis

use function yyaxis <https://www.mathworks.com/help/matlab/ref/yyaxis.html yyaxis>

3 maanden ago | 0

| accepted

Answered

colorbar problem in surf plot?

I guess the code should be like that: Tx_power =0:2:40; %1*21 Matrix size Position =1:21; %1*21 Matrix...

colorbar problem in surf plot?

I guess the code should be like that: Tx_power =0:2:40; %1*21 Matrix size Position =1:21; %1*21 Matrix...

3 maanden ago | 0

Answered

how to use iccread if the image contains no profile

Check the MATLAB documentation: iccread The file can be either an ICC profile file or a TIFF file containing an embedded ICC pr...

how to use iccread if the image contains no profile

Check the MATLAB documentation: iccread The file can be either an ICC profile file or a TIFF file containing an embedded ICC pr...

3 maanden ago | 1

| accepted

Answered

dicomwrite to save dicom image with window level setting

The matrix R coming from dicomread is the rawdata and you are not advised to change it. Most probably you are only able to chan...

dicomwrite to save dicom image with window level setting

The matrix R coming from dicomread is the rawdata and you are not advised to change it. Most probably you are only able to chan...

3 maanden ago | 0

| accepted

Answered

Count the number of times a word appears?

Use function readtable and groupsummary: clear; clc; A = readtable('demo.txt'); G = groupsummary(A,'A','sum'); A new column ...

Count the number of times a word appears?

Use function readtable and groupsummary: clear; clc; A = readtable('demo.txt'); G = groupsummary(A,'A','sum'); A new column ...

3 maanden ago | 1

Answered

How I can combine this cell values in a single matrix?

Something like this and final matrix is C clear; clc; X = cell(1,4); X{1} = round(10*rand(1,7)); ...

How I can combine this cell values in a single matrix?

Something like this and final matrix is C clear; clc; X = cell(1,4); X{1} = round(10*rand(1,7)); ...

3 maanden ago | 0

Answered

How to extract data from a specified row number (omitting first row)

Just get rid of the first data in the index: idx_rtoe_end = find(strcmp(data_raw(:, 2), '"HX210.11.31.M7-LF S0021"')); idx_rto...

How to extract data from a specified row number (omitting first row)

Just get rid of the first data in the index: idx_rtoe_end = find(strcmp(data_raw(:, 2), '"HX210.11.31.M7-LF S0021"')); idx_rto...

3 maanden ago | 0

| accepted

Answered

magnification row axis image

B = imresize(A,[28000 28000]) But I am thinking the image will be highly distorted.....

magnification row axis image

B = imresize(A,[28000 28000]) But I am thinking the image will be highly distorted.....

4 maanden ago | 0

Answered

Problem with setting specified intervals with colorbar

The limiting factor is the range of your data. If you really want the colorbar starts from 0 to 10, you need to set the limit a...

Problem with setting specified intervals with colorbar

The limiting factor is the range of your data. If you really want the colorbar starts from 0 to 10, you need to set the limit a...

4 maanden ago | 0

| accepted

Answered

create circular dot grids

Use function pol2cart clear; clc; separation = 36; % Angle separation rhoA = 10; ...

create circular dot grids

Use function pol2cart clear; clc; separation = 36; % Angle separation rhoA = 10; ...

4 maanden ago | 0

| accepted

Answered

Fail to process multiselect files by using readtable function....

Not quite understand your issue, but I guess you are not able to get the figure when the code is reading multiple files. So I ...

Fail to process multiselect files by using readtable function....

Not quite understand your issue, but I guess you are not able to get the figure when the code is reading multiple files. So I ...

4 maanden ago | 0

Answered

Error with contourf representing 3d plot in 2d

Refer to the MATLAB documentation in this Link contourf(X,Y,Z) specifies the x and y coordinates for the values in Z. However,...

Error with contourf representing 3d plot in 2d

Refer to the MATLAB documentation in this Link contourf(X,Y,Z) specifies the x and y coordinates for the values in Z. However,...

4 maanden ago | 0

| accepted