Réponse apportée
Concatenate a column of cells into a single array
cat() is also a possiblity Y = cat( 2, X{:} ); Example >> X = { rand(4,1), rand(4,1), rand(4,1) } X = 1×3 cell array ...

presque 7 ans il y a | 0

Réponse apportée
Correct way to specify default property values when constructor uses inputParser.
The default values of properties in the properties block are assigned once when the first object is created . Subsequent objects...

presque 7 ans il y a | 1

| A accepté

Réponse apportée
Code to run script multiple times
Assumtions: NFRO3Rec is a function that "accepts a vector x and returns a vector F" r is not changed in your code Alternate s...

presque 7 ans il y a | 2

A résolu


Project Euler: Problem 8, Find largest product in a large string of numbers
Find the greatest product of five consecutive digits in an n-digit number. 73167176531330624919225119674426574742355349194934...

presque 7 ans il y a

Réponse apportée
how to initialize the data from .txt data?
Try >> m1 = dlmread('H:\m\cssm\TESTRATE.txt'); >> m2 = dlmread('H:\m\cssm\DATANAME.txt'); >> whos m* Name Size ...

presque 7 ans il y a | 1

Réponse apportée
Reference To Non-Existent Field
I have reproduced the error you see - sort of. Running FruitCalculations_main on R2018b throws an error >> FruitCalculations_m...

presque 7 ans il y a | 0

| A accepté

Réponse apportée
How do i break a loop at set values to NaN
Try if alpha(i)<(-pi)||alpha(i)>(pi) x(i+1:end)=NaN; alpha(i+1:end)=NaN; break end

presque 7 ans il y a | 0

| A accepté

Réponse apportée
How can I tell which modules are being used in my program?
Try [flist,plist] = matlab.codetools.requiredFilesAndProducts('your_program_name'); the answer is in plist - hopefully See m...

presque 7 ans il y a | 2

| A accepté

Réponse apportée
Sorting from highest to lowest for a particular column
Try this %% C1 = nan( size( B(:,1:end-1) ) ); %% for rr = 1 : size(B,1) C1( rr, 2 ) = A( B(rr,2), B(rr,3) ); end C1(:...

presque 7 ans il y a | 1

Réponse apportée
Exporting data from for loop into text file
"gives me all the data in a row:" This script produces two columns %% BOLD = reshape( (1:6), [],1 ); x = (1:size(BOLD,1))./1....

presque 7 ans il y a | 0

| A accepté

Réponse apportée
four dimensions array's expression
>> size(B) ans = 2 3 1 3 the statement B = cat(4,A(:,:,1),A(:,:,2),A(:,:,3)) concatenates three 2D a...

presque 7 ans il y a | 0

Réponse apportée
How can I multiply one output of this function with another output from this function?
comment out clear all; run the script rename Tp run the a second time Or convert the script to a function that returns Tp a...

presque 7 ans il y a | 1

| A accepté

Réponse apportée
startup.m not found in local folder
This works for me. Have you set the "Start in" folder? btw: I don't think it's a good idea to put startup.m in c:\Program Fi...

presque 7 ans il y a | 1

Réponse apportée
how to read read a specific rows in .txt and put it in class?
The problem is caused by the first character of line 11. It's char(26) The function readtable() reads the file

presque 7 ans il y a | 1

| A accepté

Réponse apportée
Assigning values to an array of arbitrary dimensions in MATLAB.
"The problem I have is to be able to this with an arbitrary value of j." I think value2arrayND does that. It takes a cell array...

presque 7 ans il y a | 1

| A accepté

Réponse apportée
Speeding up the manipulation of large matrices
Your code, "diff(temp,[],2)==0,2)", made me think that temp holds whole numbers. If so, you could convert temp to an appropriate...

presque 7 ans il y a | 0

| A accepté

Réponse apportée
How can I call the variables of MATLAB workspace from a function?
Do you have a good reason for doing this? Hint: function save_base_workspace() evalin( 'base', 'save( ''save_base_works...

environ 7 ans il y a | 3

| A accepté

Réponse apportée
Convert an array of numbers into letters using logical indexing
Another approach >> grades = reshape([ 6.29, 5.87, 5.28, 7.38, 7.40, 4.07, 4.23, 7.25, 3.60 ... , 4.37, 4....

environ 7 ans il y a | 0

Réponse apportée
How to store Data in a MATLAB® data file as a MATLAB dataset object?
I successfully (R2018b) ran the example of the documentation that you linked to. Did you try it? "MATLAB dataset object" see d...

environ 7 ans il y a | 0

Réponse apportée
How to clear the workspace from within a program?
Read Base and Function Workspaces Your program is that a script or a function? Your question makes me believe your program is ...

environ 7 ans il y a | 1

Réponse apportée
Windows(CR LF) to Unix (LF)
You have a few options Open the file in Notepad++ and replace CRLF by LF as shown by the screen clip below. Use the solution, ...

environ 7 ans il y a | 1

| A accepté

Réponse apportée
Efficiently import text file with irregular struture
See Import Block of Numeric Data from Text File and How do I parse this complex text file with textscan? If you need further...

environ 7 ans il y a | 0

Réponse apportée
Getting error message, "Subscript indices must either be real positive integers or logicals."
MATLAB has indexing of arrays beginning from 1 instead of 0, thus replace for i =0:1:75 by for i =1:1:76

environ 7 ans il y a | 0

| A accepté

Réponse apportée
How to store columns of different lengths using cells
I assume that you intend to put successive values of trimtempstoreCol into cells of newData. To do that, replace newData{t...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
If statement correction help
"I need is to create an array of 1000 random variables from -1 to 0 and 1/2 to 1" Another approach >> X1 = rand(1,1e3)*1.5 - 1...

environ 7 ans il y a | 0

Réponse apportée
I'm not sure what im doing wrong on this script...
See TUTORIAL: Why Variables Should Not Be Named Dynamically (eval) Hint: %% C.black = 0; C.brown = 1; C.red = 2; C.orange...

environ 7 ans il y a | 0

Réponse apportée
string to text file
This creates a textfile, which notepadd++ opens. v1=str(:,1); v2=str(:,2); v3=str(:,3); T = table( v1,v2,v3 ); writetable(...

environ 7 ans il y a | 0

| A accepté

Réponse apportée
Merge same field of 36 structures
Try this %% numfiles = length(filenames); results = cell(numfiles, 1); for K = 1 : numfiles datastruct = load( filename...

environ 7 ans il y a | 0

Réponse apportée
access data in table using for loop
Try something like this %% idx = {'OMFGA','MBNC'}; OMFGA = cell( 1, numel(idx) ); for ii=1:numel(idx) B = strcmp(compTi...

environ 7 ans il y a | 0

Réponse apportée
How to extract values to create a table on excel?
Try >> [x,y,T] = steadyheat_jacob() where function [x,y,T] = steadyheat_jacob() %----------------------------------...

environ 7 ans il y a | 0

Charger plus