Respondida
exporting a .mat file to csv/ xls
you have to extract your data from the struct. here i am giving an example. i have attached a struct structvalue=load('data2.ma...

8 meses hace | 0

| aceptada

Respondida
How to name the sheet in excel using MATLAB
try this: writetable(T,'test.xlsx','FileType','spreadsheet','Sheet','a') % T is your output variable

8 meses hace | 2

| aceptada

Respondida
How can we find the block name in simulink. actually i have one block but i dont know that block name how can i find from simulink library
Double click on that block. you can find the name on Block Parameters pop up window

8 meses hace | 0

Respondida
multiplying matrix by a vector on an element by element basis using for loops
try this: A = [1 12 22 10 18; 20 8 13 2 25; 6 19 3 23 14; 4 24 17 15 7; 11 21 16 5 9]; B = [9 7 11 4 23]; for i = 1:size(A,1)...

8 meses hace | 0

Respondida
How can I run this code I don't know where is the fault?
As your output is a scalar value so you need to define it with Marker. and you are plotting only real values k1 = 2; k_1 = 1;...

8 meses hace | 0

| aceptada

Respondida
read csv file with a lot of columns.
try this: A=readtable('rawdata.csv','ReadVariableName',false); B=table2array(A(:,1)); C=split(B,';'); output=C(:,2:125);

8 meses hace | 0

Respondida
I want to add a definite fixed intervals between my input data
try this: distance =[0 0 5 10 15 20]; C=cell(6,1); for i=1:length(distance)-1 C{i}= distance(i):1:distance(i+1); end o...

8 meses hace | 0

| aceptada

Respondida
How to get the value corresponding to the data in an excel file
try this: A=readtable('katalog.xlsx','ReadVariableName',false); B=table2array(A(2:end,2:end)); D=str2double(string(B)); user...

8 meses hace | 0

Respondida
Having errors in a multivariable for loop.
try this: temp_int=24; temp_ext=10; U=5; hi=4; h=1:5; temp_diff=(U/hi)*(temp_int-temp_ext); x=0:0.1:2.5; X=repmat(x,size...

8 meses hace | 1

Respondida
Matlab is deleting first row of my table and setting it as table property VariableDescription
It should not work in that way.please try this A=readtable('filewithtable.csv','ReadVariableName',false);

8 meses hace | 1

| aceptada

Respondida
If condition: "in each row of a matrix one element is zero and the other one is not zero"
try this A = [ 1 0 0 9 12 0 0 2 0 3]; if nnz(A)==size(A,1) disp('in each row one element is z...

8 meses hace | 0

Respondida
read multiple columns from an excel spreadsheet by using xlsread
I guess you can not export multiple ranges data in Matlab. Range must be of the form 'A1' (cell), 'A:B' (column-select), '1:5' ...

8 meses hace | 0

Respondida
How to change the input of the function
%define your variable and call your function T1 = 288.15; L = -0.0065; R = 287; PSL = 101325; g = 9.81; rhoSL = 1.225; [T...

8 meses hace | 1

Respondida
Create table columns with some entries blank (no quote symbols)
try this: str={'Y'}; col=[{'True'};{'True'};{'False'};{'True'};{'False'};{'True'}]; T=table(col); for i=1:size(col,1) if st...

8 meses hace | 0

Respondida
Reading a massive file but skipping several lines / rows at a fixed interval
try this loop: A=(1:9990)'; % making an array idx=2000; % taken value from 2000 count=(size(A,1)+10)/idx; first_index=A(1:...

8 meses hace | 0

Respondida
How to create a file and append a suffix?
% suppose you have a excel file with name "example" A=readtable('example.xlsx') % analyze what you want % save the file writ...

8 meses hace | 0

Respondida
Trying to change cells in a table
try this: Column1Names={'type_1';'type_2';'type_3';'type_4';'type_5'}; % making another table LastName = {'Sanchez';'Johnson'...

8 meses hace | 0

| aceptada

Respondida
Compare two columns having different values.
try this: A={'a','b','c','d','e'}; B={'b','c','d','e','f'}; C={'a','-' 'b','b' 'c','c' 'd','d' 'e','e' '-.','f'}; a=[A(...

8 meses hace | 0

Respondida
Labels above bar-plot
please expand the plot for a clear view. A=1:5:200; B=1:40; bar(B) text(1:length(A),B,num2str(B'),'VerticalAlignment','botto...

8 meses hace | 0

Respondida
How to resolve issue while dealing with larger matrices?
A=randi(16,[4,4]); B=A(:)'; P=randi(16,[1 4]); V=randi(16,[1 4]); [C out]=ismember(V,B); if numel(out(out~=0)) ==4 d...

8 meses hace | 1

Respondida
how to define matirx series?
square bracket returns horizontal concatenation of input argument. i guess you can use a cell array c = {a1,a2,a3};

8 meses hace | 0

Respondida
How to define a text variable using an older text variable?
x=1:10; T = compose("batch1_%d.csv",x(:))

8 meses hace | 1

Respondida
How to replace zeros in a vector with random segments of the same vector?
try this: A=[1 2 3 0 0 0 4 5 0 0 0 0 0 0 0 0 8 9]'; % any matrix B=A(A==0); % extract the number of 0 rdnumber=randi([10 ...

8 meses hace | 0

Respondida
How do I extract column vectors from a cell of doubles array?
A=load('cell_of_doubles.mat'); B=A.cell_of_double_balls ; C=cell(size(B,2),1); for i=1:size(B,2) C{i}=B{1, i}(:,1:3); ...

8 meses hace | 0

| aceptada

Respondida
Delete rows from string array with just one value
as i don't have your data so i have added NaN string to make the same dimension cell array x={'Na','Mg','Si' NaN; 'V' NaN NaN ...

8 meses hace | 0

| aceptada

Respondida
readtable decide which coloumns are read as string and which as number. xlsx file
i have tried to make your excel and applied readtable function..see the result. A=readtable('example_2.xlsx','ReadVariableName'...

8 meses hace | 0

| aceptada

Respondida
Why do I receive the error that arrays have incompatible sizes for this operation?
try this: A=input('initial value:'); B=input('number of values:'); C=input('final value:'); % A=2; % B=10; % C=20; D=A:(C...

8 meses hace | 0

Respondida
How to export a large array from workspace to an excel sheet [Ed. so that NaNs are preserved] ?
try this: A=[1 2 3; NaN 3 NaN; 4 NaN 7]; % made a matrix with Nan value B=num2cell(A) B(isnan(A)) ={'NaN'}; % NaN as a stri...

8 meses hace | 0

| aceptada

Respondida
How can I reshape a square matrix to a rectangular matrix based on its adjacency list?
try this: A =[0 1 0 1 0 1 0 1 1 0 0 1 0 1 1 1 1 1 0 1 0...

8 meses hace | 3

Respondida
how to adjust x-axis in plot
try repmat function: A=[30 2 4 6 8 10]; no_of_rows=1; no_of_repeated_times=3; B=repmat(A,no_of_rows,no_of_repeated_times)

8 meses hace | 0

Cargar más