Réponse apportée
Cannot seem to save data to a file within a class
Yes, there is. To make it work, replace evalin('base', sprintf('save(''%s'', ''data'')', s.fileLoc)); by save( s.f...

environ 8 ans il y a | 1

| A accepté

Question


How to suppress message of validatestring?
z = validatestring( 'azaa', {'aaa','bbb'} ); outputs in red to the Command Window Expected input to match one of t...

environ 8 ans il y a | 1 réponse | 0

1

réponse

Réponse apportée
how to model a battery energy storage system in matlab
See <https://se.mathworks.com/matlabcentral/fileexchange/?search_submit=fileexchange&query=Lithium-Ion++Battery+&term=Lithium-Io...

environ 8 ans il y a | 0

| A accepté

Réponse apportée
Assgin a name to sequentially imported files
Given *|dataStruct|*. An alternative approach results = structfun( @do_some_operations_on, dataStruct, 'uni',false ); wh...

environ 8 ans il y a | 0

Réponse apportée
How to compare strings in a cell
Try this %% Sample data str = char(randi(double(['A','Z']),[20,3] )); % Too smart cac = mat2cell( str, ones(1,20),3 ...

environ 8 ans il y a | 0

| A accepté

Réponse apportée
Writing a Leap year function without using the leapyr function
See <https://en.wikipedia.org/wiki/Gregorian_calendar> Every year that is exactly divisible by four is a leap year, except f...

environ 8 ans il y a | 1

| A accepté

Réponse apportée
Help with optimising my code?
%% xMat = randn( 12, 1); edges = ( - 4 : 1 : 4 ); yMat = ( 1 : 12 )'; %% [ N, bin ] = histc( xMat, edge...

environ 8 ans il y a | 1

| A accepté

Réponse apportée
Need help in correction of error for training my data
The message says: Cell contents reference from a non-cell array object An example of this error >> a=17; >> a{1}...

environ 8 ans il y a | 0

| A accepté

Réponse apportée
how to select a random number from the existing matrix in each column
It's smarter to use a for-loop >> A A = 1 2 3 4 5 6 7 8 9 10 11 ...

environ 8 ans il y a | 0

Réponse apportée
My Newton's Method "for loop" and table only displays the last iteration. I would like it to display all iterations. How do I do this?
Currently you overwrite the table, T, in every iteration. Replace T = table(i,t,f,dt,t0); by if i == 1 T = ...

environ 8 ans il y a | 0

Réponse apportée
How do you create a new vector using every other number from your original vector. Including the first number of the original vector.
An example >> vec = randi(3,1,18) % test data vec = Columns 1 through 14 3 3 1 3 2 1 ...

environ 8 ans il y a | 0

Réponse apportée
How can I delete numeric Headings/Delimiters from a large text file
And with regular expressions >> out = cssm('examplefile.txt'); >> out(1:32) ans = 1 5 0 0 2 15 0 0 3 2...

environ 8 ans il y a | 0

Réponse apportée
this is my code and it has a problem while calculating kafa=y2/y12
Error using / Matrix dimensions must agree. >> whos y2 y12 Name Size Bytes Class Attrib...

environ 8 ans il y a | 0

| A accepté

Réponse apportée
Replace numbers by strings
One way: A = randi([80,100], 1,100 ); % Sample data C = cell(size(A)); C(A<90)={'case1'}; C(A>=90)={'case2'}; r...

environ 8 ans il y a | 5

| A accepté

Réponse apportée
How to replace a missing value of a table with a cell?
*|test.csv|* contains two rows Features,,,,,,,,,,,,,,,,,,,, F1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,,18,19,20 That ...

environ 8 ans il y a | 1

| A accepté

Réponse apportée
How to create a matrix that contains members with specific different between each element ?
Starter: >> cumsum([1,A]) ans = 1 5 12 27

environ 8 ans il y a | 0

| A accepté

Réponse apportée
How to change workspace of imageSegmenter from 'base' to 'current' to access the binary masks created by ImageSegmenter?
The export feature of imageSegmenter saves the picture to the base workspace. There is no alternative as far as I can see. I...

environ 8 ans il y a | 0

Réponse apportée
Importing multiple .dat files in MATLAB
Try >> out = cssm( 'h:\m\cssm\trial*.dat' ) it should return out = 1x5 struct array with fields: name ...

environ 8 ans il y a | 0

Réponse apportée
How to delete/retain variables (columns) from a table based on sections of the variables name
One way %% Sample table tbl = array2table( magic(5) ); tbl.Properties.VariableNames = .....

environ 8 ans il y a | 1

| A accepté

Réponse apportée
Preallocate object array problem: Toolbox Path
Starter: array(1,10) = mix.track(file);

environ 8 ans il y a | 0

| A accepté

Réponse apportée
How can i change data from arrays position to NaNs?
Hint >> Data(Flag==1) = nan;

environ 8 ans il y a | 0

| A accepté

Réponse apportée
Extract matrix from vector of .mat file
Try i.imageLabelCell{1}(:,1)

environ 8 ans il y a | 0

| A accepté

Réponse apportée
How to read large text data into matlab
*Given:* * All headers consist of 9 lines * All data blocks consist of 7 columns of numerical data * The blocks of numerica...

environ 8 ans il y a | 1

Réponse apportée
How to load mat file located in a package folder (.../+folder/matfile.mat)
Given ...\+pkg\cls.m ...\+pkg\matfile.mat Try this >> obj = pkg.cls obj = cls with properties: ...

plus de 8 ans il y a | 0

Réponse apportée
Reading specific rows and columns of numerical values from a text file
Here is an implementation along the lines suggested by <https://se.mathworks.com/matlabcentral/answers/373798-reading-specific-r...

plus de 8 ans il y a | 0

Réponse apportée
How to extract multiple matrices from a big set (Large Matrix) of data?
Use this code to study for-loop and indexing. Put a break-point at *|17;|* %% MNP130 = 1:(5*5*14680*30); % a 1D doubl...

plus de 8 ans il y a | 0

Réponse apportée
how to extract file name
If I got you question right cac = { '0101.txt', '0103.txt', '3001.txt', '3003.txt' }; out = regexp( cac, '^\d{2}', 'matc...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
Remove columns for a cell array
One way >> cac = cell(10,3000); >> cac = cac(:,1:end-1000); >> size(cac) ans = 10 2000 >> ...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
Calling a Function From Another Function
M = table_1( data ); food( M ); or food( table_1( M ) ); The two line construct is easier to debug where...

plus de 8 ans il y a | 0

Réponse apportée
I want to make the following row matrix looks like a matrix with rows and columns.
Column major A = [ 296, 2, 47, 296, ... ]; B = reshape( A, 3,4 ); C = permute( B, [2,1] ) outputs C = 2...

plus de 8 ans il y a | 0

Charger plus